kailaix / ADCME.jl

Automatic Differentiation Library for Computational and Mathematical Engineering
https://kailaix.github.io/ADCME.jl/latest/
MIT License
286 stars 57 forks source link

fc() cant be labeled when initialising the weights #49

Closed acse-ncv19 closed 4 years ago

acse-ncv19 commented 4 years ago

config = [20, 20, 20, 20, 20, 20, 20, 20, 1] θ = Variable(fc_init([2; config]))

u_nn = squeeze(fc(train_input, config, θ, "concave")) + 1

I got this kind of code but it only runs if i choose between labling the NN of initialising the weights. When doing both I get this error:

ERROR: LoadError: MethodError: no method matching ae(::PyCall.PyObject, ::Array{Int64,1}, ::PyCall.PyObject, ::String)

kailaix commented 4 years ago

fc(train_input, config, θ) doesn't need a label. You can regard θ as its label if you wish. The existence of labels is to mark different neural networks, but since you provide θ to the neural network, the neural network is uniquely defined by θ.

acse-ncv19 commented 4 years ago

thank you very much for this answer. This is very helpful to know.