Loss functions added to docs

This commit is contained in:
thebhatman 2019-04-05 23:50:16 +05:30
parent b84ab7ac95
commit 710084ffbf
1 changed files with 12 additions and 0 deletions

View File

@ -32,6 +32,18 @@ Flux.train!(loss, ps, data, opt)
The objective 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 `crossentropy` for cross entropy loss, but you can calculate it however you want.
In-built loss functions:
```@docs
mse
crossentropy
logitcrossentropy
binarycrossentropy
logitbinarycrossentropy
kldivergence
poisson
hinge
```
## Datasets
The `data` argument provides a collection of data to train with (usually a set of inputs `x` and target outputs `y`). For example, here's a dummy data set with only one data point: