Skip to content

Instantly share code, notes, and snippets.

@Arkoniak
Created March 11, 2020 09:48
Show Gist options
  • Save Arkoniak/21e6bf5dbe52707cf90e9033435a580b to your computer and use it in GitHub Desktop.
Save Arkoniak/21e6bf5dbe52707cf90e9033435a580b to your computer and use it in GitHub Desktop.
struct NeuralNet
NetDimensions::Array
LossFunction::String
params::Dict
end
function NeuralNet(dims, loss="someloss")
param = Dict()
for l=2:length(dims)
param["W_$(l-1)"] = rand(dims[l], dims[l-1]) * 0.1
param["b_$(l-1)"] = zeros(dims[l] , 1)
end
return NeuralNet(dims, loss, param)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment