-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from DrChainsaw/funcmemo
Change examples and test to use explicit gradients
- Loading branch information
Showing
10 changed files
with
133 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using PrecompileTools | ||
|
||
let | ||
@setup_workload begin | ||
iv1 = denseinputvertex("iv1", 1) | ||
v1 = fluxvertex("v1", Dense(nout(iv1) => 1), iv1) | ||
v2 = concat("v2", v1, v1; layerfun=ActivationContribution) | ||
v3 = concat("v3", v2,v1,iv1) | ||
v4 = "v4" >> v3 + v3 | ||
v5 = "v5" >> v4 + v4 + v4 | ||
v6 = fluxvertex("v6", Dense(nout(v5) => 1), v5; layerfun = ActivationContribution ∘ LazyMutable) | ||
|
||
g1 = CompGraph(iv1, v6) | ||
x1 = ones(Float32, 1, 1) | ||
|
||
@compile_workload begin | ||
iv1 = denseinputvertex("iv1", 1) | ||
fluxvertex("v1", Dense(nout(iv1) => 1), iv1) | ||
|
||
g1(x1) | ||
Flux.@code_adjoint g1(x1) | ||
#Optimisers.setup(Optimisers.Descent(0.1f0), g1) | ||
#Flux.gradient((g,x) -> sum(g(x)), g1, x1) | ||
|
||
Δnout!(v3 => relaxed(2)) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f502e5f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
f502e5f
There was a problem hiding this comment.
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/89186
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: