Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

How to create a Flux model from parameter vector?

$
0
0

Hi,
I have a parameter vector and shape array as below:

shape =[((2,5),2),((2,2),2)] #shape of layers : weights and bias

w = rand(18) #weights and bias together.

In this case elements of w are divided as below:

  • First 10 elements of w are weights of layer 1
  • Next 2 elements of w are bias of layer 1
  • First 4elements of w are weights of layer 2
  • Next 2 elements of w are bias of layer 2

What will be the best way to create a Flux model using like below using elements of w

Chain(Dense(5,2), Dense(2,2))

Thanks and Regards
Manu

4 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles