clarify
This commit is contained in:
parent
5fd1b7d9a2
commit
c202e2bc1a
|
@ -25,6 +25,9 @@ m = Chain(
|
|||
|
||||
# Model loss function
|
||||
loss(x, y) = Flux.mse(m(x), y)
|
||||
|
||||
# later
|
||||
Flux.train!(loss, data, opt)
|
||||
```
|
||||
|
||||
The loss will almost always be defined in terms of some *cost function* that measures the distance of the prediction `m(x)` from the target `y`. Flux has several of these built in, like `mse` for mean squared error or `logloss` for cross entropy loss, but you can calculate it however you want.
|
||||
|
|
Loading…
Reference in New Issue