Commit
·
558332d
1
Parent(s):
3fa6400
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This model is for anyone using using Flux.jl and looking for a test model to make sue of the Hugging Face hub. You can see the source code to generate this model below:
|
| 2 |
+
|
| 3 |
+
```Julia
|
| 4 |
+
julia> using Flux
|
| 5 |
+
|
| 6 |
+
julia> model = Chain(Dense(10, 5, NNlib.relu), Dense(5, 2), NNlib.softmax)
|
| 7 |
+
Chain(Dense(10, 5, NNlib.relu), Dense(5, 2), NNlib.softmax)
|
| 8 |
+
|
| 9 |
+
julia> using BSON: @save
|
| 10 |
+
|
| 11 |
+
julia> @save "mymodel.bson" model
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
you can then load the model in Julia as follows:
|
| 15 |
+
|
| 16 |
+
```Julia
|
| 17 |
+
julia> using Flux
|
| 18 |
+
|
| 19 |
+
julia> using BSON: @load
|
| 20 |
+
|
| 21 |
+
julia> @load "mymodel.bson" model
|
| 22 |
+
|
| 23 |
+
julia> model
|
| 24 |
+
Chain(Dense(10, 5, NNlib.relu), Dense(5, 2), NNlib.softmax)
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
See here: https://fluxml.ai/Flux.jl/stable/saving/#Saving-and-Loading-Models for more details!
|