Skip to content

Commit

Permalink
Merge pull request #223 from SciML/fm/bugfix
Browse files Browse the repository at this point in the history
weight init bugfix
  • Loading branch information
MartinuzziFrancesco authored Oct 15, 2024
2 parents f9dd263 + 93d5781 commit a92e73a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ReservoirComputing"
uuid = "7c2d2b1e-3dd4-11ea-355a-8f6a8116e294"
authors = ["Francesco Martinuzzi"]
version = "0.10.2"
version = "0.10.3"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
8 changes: 5 additions & 3 deletions src/ReservoirComputing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ function Predictive(prediction_data)
Predictive(prediction_data, prediction_len)
end

__partial_apply(fn, inp) = fn$inp

#fallbacks for initializers
for initializer in (:rand_sparse, :delay_line, :delay_line_backward, :cycle_jumps,
:simple_cycle, :pseudo_svd,
Expand All @@ -83,13 +85,13 @@ for initializer in (:rand_sparse, :delay_line, :delay_line_backward, :cycle_jump
return $initializer(WeightInitializers._default_rng(), T, dims...; kwargs...)
end
@eval function ($initializer)(rng::AbstractRNG; kwargs...)
return WeightInitializers.__partial_apply($initializer, (rng, (; kwargs...)))
return __partial_apply($initializer, (rng, (; kwargs...)))
end
@eval function ($initializer)(rng::AbstractRNG,
::Type{T}; kwargs...) where {T <: $NType}
return WeightInitializers.__partial_apply($initializer, ((rng, T), (; kwargs...)))
return __partial_apply($initializer, ((rng, T), (; kwargs...)))
end
@eval ($initializer)(; kwargs...) = WeightInitializers.__partial_apply(
@eval ($initializer)(; kwargs...) = __partial_apply(
$initializer, (; kwargs...))
end

Expand Down

2 comments on commit a92e73a

@MartinuzziFrancesco
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/117310

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.3 -m "<description of version>" a92e73a0d8f3068dc197b83995ce0069843d73e6
git push origin v0.10.3

Please sign in to comment.