Improve directory setup #66
Triggered via pull request
December 16, 2024 10:52
Status
Failure
Total duration
10m 44s
Artifacts
–
Annotations
2 errors
Documentation:
src/derivatives/pullback.jl#L42
doctest failure in ~/work/SymbolicNeuralNetworks.jl/SymbolicNeuralNetworks.jl/src/derivatives/pullback.jl:42-68
```jldoctest
using SymbolicNeuralNetworks
using AbstractNeuralNetworks
using Symbolics
import Random
Random.seed!(123)
c = Chain(Dense(2, 1, tanh))
nn = NeuralNetwork(c)
snn = SymbolicNeuralNetwork(nn)
loss = FeedForwardLoss()
pb = SymbolicPullback(snn, loss)
input_output = (rand(2), rand(1))
loss_and_pullback = pb(nn.params, nn.model, input_output)
# note that we apply the second argument to another input `1`
pb_values = loss_and_pullback[2](1)
@variables soutput[1:SymbolicNeuralNetworks.output_dimension(nn.model)]
symbolic_pullbacks = SymbolicNeuralNetworks.symbolic_pullback(loss(nn.model, nn.params, nn.input, soutput), nn)
pb_values2 = build_nn_function(symbolic_pullbacks, nn.params, nn.input, soutput)(input_output[1], input_output[2], ps)
pb_values == (pb_values2 |> SymbolicNeuralNetworks._get_params |> SymbolicNeuralNetworks._get_contents)
# output
true
```
Subexpression:
using SymbolicNeuralNetworks
using AbstractNeuralNetworks
using Symbolics
import Random
Random.seed!(123)
c = Chain(Dense(2, 1, tanh))
nn = NeuralNetwork(c)
snn = SymbolicNeuralNetwork(nn)
loss = FeedForwardLoss()
pb = SymbolicPullback(snn, loss)
input_output = (rand(2), rand(1))
loss_and_pullback = pb(nn.params, nn.model, input_output)
# note that we apply the second argument to another input `1`
pb_values = loss_and_pullback[2](1)
@variables soutput[1:SymbolicNeuralNetworks.output_dimension(nn.model)]
symbolic_pullbacks = SymbolicNeuralNetworks.symbolic_pullback(loss(nn.model, nn.params, nn.input, soutput), nn)
pb_values2 = build_nn_function(symbolic_pullbacks, nn.params, nn.input, soutput)(input_output[1], input_output[2], ps)
pb_values == (pb_values2 |> SymbolicNeuralNetworks._get_params |> SymbolicNeuralNetworks._get_contents)
Evaluated output:
ERROR: type NeuralNetwork has no field input
Stacktrace:
[1] getproperty(x::NeuralNetwork{AbstractNeuralNetworks.UnknownArchitecture, Chain{Tuple{Dense{2, 1, true, GenericActivation{typeof(tanh)}}}}, NeuralNetworkParameters{(:L1,), Tuple{@NamedTuple{W::Matrix{Float64}, b::Vector{Float64}}}}, CPU}, f::Symbol)
@ Base ./Base.jl:49
[2] top-level scope
@ none:1
Expected output:
true
diff =
Warning: Diff output requires color.
trueERROR: type NeuralNetwork has no field input
Stacktrace:
[1] getproperty(x::NeuralNetwork{AbstractNeuralNetworks.UnknownArchitecture, Chain{Tuple{Dense{2, 1, true, GenericActivation{typeof(tanh)}}}}, NeuralNetworkParameters{(:L1,), Tuple{@NamedTuple{W::Matrix{Float64}, b::Vector{Float64}}}}, CPU}, f::Symbol)
@ Base ./Base.jl:49
[2] top-level scope
@ none:1
|
Documentation
Process completed with exit code 1.
|