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

add dilation parameter to convolution layers (match mlx.nn) #183

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

davidkoski
Copy link
Collaborator

No description provided.

@davidkoski davidkoski requested a review from awni January 17, 2025 19:04
@@ -15,6 +15,7 @@ open class Conv1d: Module, UnaryLayer {
public let weight: MLXArray
public let bias: MLXArray?
public let padding: Int
public let dilation: Int
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding dilation parameter to match python (mlx.nn)

/// - bias: if `true` add a learnable bias to the output
public init(
inputChannels: Int,
outputChannels: Int,
kernelSize: IntOrTriple,
stride: IntOrTriple = 1,
padding: IntOrTriple = 0,
dilation: IntOrTriple = 1,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Curiously the mlx.nn version doesn't have dilation on Conv3d -- oversight or is this omitted for a reason?

@awni

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for checking! That looks like an oversight. I will add it.

@davidkoski davidkoski merged commit 1b6334a into ml-explore:main Jan 27, 2025
3 checks passed
@davidkoski davidkoski deleted the convolution-dilation branch January 27, 2025 23:13
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.

2 participants