Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

session_run_hook

Create Custom Session Run Hooks


Description

Create a set of session run hooks, used to record information during training of an estimator. See Details for more information on the various hooks that can be defined.

Usage

session_run_hook(begin = function() { },
  after_create_session = function(session, coord) { },
  before_run = function(context) { }, after_run = function(context,
  values) { }, end = function(session) { })

Arguments

begin

function(): An R function, to be called once before using the session.

after_create_session

function(session, coord): An R function, to be called once the new TensorFlow session has been created.

before_run

function(run_context): An R function to be called before a run.

after_run

function(run_context, run_values): An R function to be called after a run.

end

function(session): An R function to be called at the end of the session.

Typically, you'll want to define a before_run() hook that defines the set of tensors you're interested in for a particular run, and then you'll use the resulting values of those tensors in your after_run() hook. The tensors requested in your before_run() hook will be made available as part of the second argument in the after_run() hook (the values argument).

See Also


tfestimators

Interface to 'TensorFlow' Estimators

v1.9.1
Apache License 2.0
Authors
JJ Allaire [aut], Yuan Tang [aut] (<https://orcid.org/0000-0001-5243-233X>), Kevin Ushey [aut], Kevin Kuo [aut, cre] (<https://orcid.org/0000-0001-7803-7901>), Daniel Falbel [ctb, cph], RStudio [cph, fnd], Google Inc. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.