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

Leakyrelu #103

Merged
merged 5 commits into from
May 20, 2024
Merged

Leakyrelu #103

merged 5 commits into from
May 20, 2024

Conversation

ordicker
Copy link
Contributor

Hi,

Sorry for disappearing, it was a bit crazy here for the last 7 months.
Anyway, I have added Leakyrelu support with the onnx_backend tests.

I have found that there are some discrepancies between pytorch and NNlib.jl (in about 1e-8), So I have changed == to \approx link
What do you think about that?

PR Checklist

  • Tests are added
  • Documentation, if applicable
    internal

@ordicker
Copy link
Contributor Author

Not sure why julia-1.6 failed, do we have to support it?

@dfdx
Copy link
Collaborator

dfdx commented May 17, 2024

The test fails because in earlier versions Julia generates separate methods for functions with and without keywords. The type of leakyrelu with keywords is actually var"#leakyrelu##kw, which you do not cover in the save!() method. The simplest way to support kw version to is to use @opconfig_kw() macro - see save!() for convolution for an example. Would it be possible to make this little change in this PR?

@ordicker
Copy link
Contributor Author

Ok that was super simple, sorry for the delay, I had problems reverting to julia1.6 on my computer.
As for the approx vs ==, do you think it's better to solve it in this package or in NNlib.jl?

BTW, yolo-v2 is loading and running. Hopefully, it will output the right results.

@dfdx
Copy link
Collaborator

dfdx commented May 20, 2024

I see it works now, thank you!

@dfdx dfdx merged commit 9cd42b9 into FluxML:master May 20, 2024
2 checks passed
@dfdx
Copy link
Collaborator

dfdx commented May 20, 2024

I had problems reverting to julia1.6 on my computer

Usually, I simply remove ~/.julia and start over. But it may be painful sometimes.

As for the approx vs ==, do you think it's better to solve it in this package or in NNlib.jl?

Little inconsistencies may come from different implementations of the underlying stack such as BLAS. The difference in the order of 1e-8 is considered absolutely normal.

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