From dafb11e20dcf5849e356522fe0f2167924667385 Mon Sep 17 00:00:00 2001 From: autodocs Date: Tue, 17 Oct 2017 17:02:11 +0000 Subject: [PATCH] build based on 23674b2 --- latest/models/layers.html | 2 +- latest/search_index.js | 2 +- latest/training/training.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/latest/models/layers.html b/latest/models/layers.html index 89a4fb6f..e30d41cf 100644 --- a/latest/models/layers.html +++ b/latest/models/layers.html @@ -11,4 +11,4 @@ m(5) == 26 m = Chain(Dense(10, 5), Dense(5, 2)) x = rand(10) -m(x) == m[2](m[1](x))

Chain also supports indexing and slicing, e.g. m[2] or m[1:end-1]. m[1:3](x) will calculate the output of the first three layers.

source
Flux.DenseType.
Dense(in::Integer, out::Integer, σ = identity)

Creates a traditional Dense layer with parameters W and b.

y = σ.(W * x .+ b)

The input x must be a vector of length in, or a batch of vectors represented as an in × N matrix. The out y will be a vector or batch of length in.

source
+m(x) == m[2](m[1](x))

Chain also supports indexing and slicing, e.g. m[2] or m[1:end-1]. m[1:3](x) will calculate the output of the first three layers.

source
Flux.DenseType.
Dense(in::Integer, out::Integer, σ = identity)

Creates a traditional Dense layer with parameters W and b.

y = σ.(W * x .+ b)

The input x must be a vector of length in, or a batch of vectors represented as an in × N matrix. The out y will be a vector or batch of length in.

source
diff --git a/latest/search_index.js b/latest/search_index.js index d051e0bd..7814fceb 100644 --- a/latest/search_index.js +++ b/latest/search_index.js @@ -181,7 +181,7 @@ var documenterSearchIndex = {"docs": [ "page": "Training", "title": "Loss Functions", "category": "section", - "text": "The loss that we defined in basics is completely valid for training. We can also define a loss in terms of some model:m = Chain(\n Dense(784, 32, σ),\n Dense(32, 10), softmax)\n\n# Model loss function\nloss(x, y) = Flux.mse(m(x), y)\n\n# later\nFlux.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." + "text": "The loss that we defined in basics is completely valid for training. We can also define a loss in terms of some model:m = Chain(\n Dense(784, 32, σ),\n Dense(32, 10), softmax)\n\n# Model loss function\nloss(x, y) = Flux.mse(m(x), y)\n\n# later\nFlux.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 crossentropy for cross entropy loss, but you can calculate it however you want." }, { diff --git a/latest/training/training.html b/latest/training/training.html index 9ab44956..d9379b1b 100644 --- a/latest/training/training.html +++ b/latest/training/training.html @@ -14,7 +14,7 @@ ga('send', 'pageview'); 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.

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:

x = rand(784)
+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 crossentropy for cross entropy loss, but you can calculate it however you want.

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:

x = rand(784)
 y = rand(10)
 data = [(x, y)]

Flux.train! will call loss(x, y), calculate gradients, update the weights and then move on to the next data point if there is one. We can train the model on the same data three times:

data = [(x, y), (x, y), (x, y)]
 # Or equivalently