SciML / SciMLBook

Parallel Computing and Scientific Machine Learning (SciML): Methods and Applications (MIT 18.337J/6.338J)
https://book.sciml.ai/
1.84k stars 331 forks source link

Two code errors in Lecture 3 Notes (probably due to Flux library changes) #61

Closed MatthewAHarvey closed 2 years ago

MatthewAHarvey commented 2 years ago

Suggest Correction

  1. Line 378 in https://github.com/SciML/SciMLBook/blob/master/_weave/lecture03/sciml.jmd
NN[1].weights # The W matrix of the first layer

produces ERROR: type Dense has no field weights: [image](https://book.sciml.ai/notes/03/)

I think the line should read

NN[1].weight # The W matrix of the first layer

(weight instead of weights)

  1. Line 384 also in https://github.com/SciML/SciMLBook/blob/master/_weave/lecture03/sciml.jmd
p = params(NN)

Produces ERROR: UndefVarError: params not defined [image](https://book.sciml.ai/notes/03/)

I don't think Flux is exposing params with the using Flux command any more so I think the line should now read

p = Flux.params(NN)

Those screenshots are taken from https://book.sciml.ai/notes/03/