We want to support the following model definition:
prelu(x) = x > 0 ? x : 0.01 * x
@model function artificial_neuron(data, out)
w ~ Normal(0, 1)
p_out := w * data
out ~ prelu(p_out)
end
@model function neural_net_layer(indata out, width)
for i in 1:width
for j in eachindex(data)
out[i] ~ artificial_neuron(data=data[j])
end
end
end
@model function my_model(data, out)
hidden ~ neural_net_layer(data=data, width=5)
out ~ neural_net_layer(data=hidden, width=1)
end
We want to support the following model definition: