Permalink
Browse files

clarify fit_generator docs

  • Loading branch information...
jjallaire committed Jun 29, 2017
1 parent f2c4487 commit f50a62bd0c4374a7292a78282758e45d494e2d38
Showing with 39 additions and 14 deletions.
  1. +13 −8 R/model.R
  2. +14 −3 docs/reference/fit_generator.html
  3. +12 −3 man/fit_generator.Rd
View
@@ -297,14 +297,15 @@ test_on_batch <- function(object, x, y, sample_weight = NULL) {
#' Fits the model on data yielded batch-by-batch by a generator.
#'
#'
#' The generator is run in parallel to the model, for efficiency. For instance,
#' this allows you to do real-time data augmentation on images on CPU in
#' parallel to training your model on GPU.
#'
#'
#' @param object Keras model object
#' @param generator a generator. The output of the generator must be either - a
#' list (inputs, targets) - a list (inputs, targets, sample_weights). All
#' @param generator A generator (e.g. like the one provided by
#' [flow_images_from_directory()]. The output of the generator must be either
#' - a list (inputs, targets) - a list (inputs, targets, sample_weights). All
#' arrays should contain the same number of samples. The generator is expected
#' to loop over its data indefinitely. An epoch finishes when
#' `steps_per_epoch` batches have been seen by the model.
@@ -331,12 +332,16 @@ test_on_batch <- function(object, x, y, sample_weight = NULL) {
#' children processes.
#' @param initial_epoch epoch at which to start training (useful for resuming a
#' previous training run)
#'
#'
#'
#' @note Note that the `fit_generator()` function is included for use with
#' built-in generators like [flow_images_from_directory()]. It's currently not
#' possible to implement generators in R. If you want to stream training data
#' within R you should use the [train_on_batch()] function.
#'
#' @return Training history object (invisibly)
#'
#'
#' @family model functions
#'
#'
#' @export
fit_generator <- function(object, generator, steps_per_epoch, epochs = 1, verbose = 1,
callbacks = NULL, validation_data = NULL, validation_steps = NULL,
@@ -144,11 +144,13 @@ <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Ar
</tr>
<tr>
<th>generator</th>
<td><p>a generator. The output of the generator must be either - a
list (inputs, targets) - a list (inputs, targets, sample_weights). All
<td><p>A generator (e.g. like the one provided by
<code><a href='flow_images_from_directory.html'>flow_images_from_directory()</a></code>. The output of the generator must be either</p><ul>
<li><p>a list (inputs, targets) - a list (inputs, targets, sample_weights). All
arrays should contain the same number of samples. The generator is expected
to loop over its data indefinitely. An epoch finishes when
<code>steps_per_epoch</code> batches have been seen by the model.</p></td>
<code>steps_per_epoch</code> batches have been seen by the model.</p></li>
</ul></td>
</tr>
<tr>
<th>steps_per_epoch</th>
@@ -212,6 +214,13 @@ <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Training history object (invisibly)</p>
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
<p>Note that the <code>fit_generator()</code> function is included for use with
built-in generators like <code><a href='flow_images_from_directory.html'>flow_images_from_directory()</a></code>. It's currently not
possible to implement generators in R. If you want to stream training data
within R you should use the <code><a href='train_on_batch.html'>train_on_batch()</a></code> function.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<p>Other model functions: <code><a href='compile.html'>compile</a></code>,
@@ -236,6 +245,8 @@ <h2>Contents</h2>
<li><a href="#value">Value</a></li>
<li><a href="#note">Note</a></li>
<li><a href="#see-also">See also</a></li>
</ul>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit f50a62b

Please sign in to comment.