I have read most of the documentation on Callbacks, but I still have an issue, that does not appear to be covered.
Here is a fragment of a longer section from an UODE:
λ8 = (T8_11 + T8_22 + T8_33)/2
# λ9 = tr(σ⋅γd)
λ9 = (T6_11 + T6_22 + T6_33) / 2f0
# Run the integrity basis through a neural network
model_inputs = [λ1;λ2;λ3;λ4;λ5;λ6;λ7;λ8;λ9]
g1,g2,g3,g4,g5,g6,g7,g8,g9 = model_univ(model_inputs, model_weights)
# tst that this code is being executed. Plot should change. The code was indeed executing,
# and the solution did not change from its initial value. This must imply that the nonlinearity
# has very little effect.
#g1,g2,g3,g4,g5,g6,g7,g8,g9 = 0., 0., 0., 0., 0., 0., 0., 0., 0.
# Save g1 through g9 per epoch. Once trained
#println("g1->g9: $t, $g1, $g2, $g3, $g4, $g5, $g6, $g7, $g8, $g9")
if dct[:captureG]
coef = [t, g1,g2,g3,g4,g5,g6,g7,g8,g9]
push!(tdnn_coefs, coef)
trace = [t, λ1, λ2, λ3, λ4, λ5, λ5, λ6, λ7, λ8, λ9]
push!(tdnn_traces, trace)
end
# Tensor combining layer
F11 = g1 + g2*σ11 + g3*γd11 + g4*T4_11 + g5*T5_11 + g6*T6_11 + g7*T7_11 + g8*T8_11 + g9*T9_11
F22 = g1 + g2*σ22 + g3*γd22 + g4*T4_22 + g5*T5_22 + g6*T6_22 + g7*T7_22 + g8*T8_22 + g9*T9_22
The driver function is called at fixed time intervals time steps. I wish to capture coef
and trace
at saveat. Is there a simple flag I could test inside the function to determine whether or not I am at one of the saveat
times? I do not wish to introduce additional interpolations into the problem. Thanks!