Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes conv transpose stride bug, adds more docs to upscale2d #658

Merged
merged 8 commits into from
Apr 4, 2023

Conversation

coreylowman
Copy link
Owner

@coreylowman coreylowman commented Apr 3, 2023

Resolves #657

There were two bugs here:

  1. patches stride was incorrect in the actual kernel - was using op.chan_in instead of op.chan_out
  2. In the backward pass gemm_batched call, it was not broadcasted the filters (so using m * n instead of 0)

Additionally I added a bunch of tests and cleaned up the implementations.

I also changed upscale methods to accept the method as a paramter. This is for a number of reasons:

  1. This allows us to actually add args to each of the methods in the future, and use them in the methods.
  2. It unifies the compile & run time shape calls.

Comment on lines +107 to +115
/// let y: Tensor<Rank3<3, 64, 64>, f32, _> = t.upscale2d(NearestNeighbor);
/// ```
///
/// Runtime upscale:
/// ```rust
/// # use dfdx::prelude::*;
/// # let dev: Cpu = Default::default();
/// let t: Tensor<Rank3<3, 32, 32>, f32, _> = dev.zeros();
/// let y: Tensor<(Const<3>, usize, usize), f32, _> = t.upscale2d_like(NearestNeighbor, 64, 64);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface to upscale2d has changed. It now takes in the method as a parameter so you can call it like in these examples (notably without specifying any generics in either case). This unifies how you call them in both const/runtime situations, as before you would've had to specify the method in the generic both ways

@coreylowman coreylowman merged commit e2017fc into main Apr 4, 2023
@coreylowman coreylowman deleted the upscale-docs branch April 4, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Odd behavior when training
1 participant