LostTech.TensorFlow : API Documentation

Type RNNEstimator

Namespace tensorflow_estimator.contrib.estimator

Parent Estimator

Interfaces IRNNEstimator

Public instance methods

object experimental_export_all_saved_models(object export_dir_base, object input_receiver_fn_map, object assets_extra, bool as_text, object checkpoint_path)

object experimental_export_all_saved_models_dyn(object export_dir_base, object input_receiver_fn_map, object assets_extra, ImplicitContainer<T> as_text, object checkpoint_path)

object export_saved_model(object export_dir_base, PythonFunctionContainer serving_input_receiver_fn, object assets_extra, bool as_text, object checkpoint_path, ImplicitContainer<T> experimental_mode)

object export_saved_model_dyn(object export_dir_base, object serving_input_receiver_fn, object assets_extra, ImplicitContainer<T> as_text, object checkpoint_path, ImplicitContainer<T> experimental_mode)

Exports a tf.keras.Model as a Tensorflow SavedModel. (deprecated)

Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Please use `model.save(..., save_format="tf")` or `tf.keras.models.save_model(..., save_format="tf")`.

Note that at this time, subclassed models can only be saved using `serving_only=True`.

The exported `SavedModel` is a standalone serialization of Tensorflow objects, and is supported by TF language APIs and the Tensorflow Serving system. To load the model, use the function tf.keras.experimental.load_from_saved_model.

The `SavedModel` contains:

1. a checkpoint containing the model weights. 2. a `SavedModel` proto containing the Tensorflow backend graph. Separate graphs are saved for prediction (serving), train, and evaluation. If the model has not been compiled, then only the graph computing predictions will be exported. 3. the model's json config. If the model is subclassed, this will only be included if the model's `get_config()` method is overwritten.

Example:
Parameters
object export_dir_base
object serving_input_receiver_fn
object assets_extra
ImplicitContainer<T> as_text
bool, `False` by default. Whether to write the `SavedModel` proto in text format. Currently unavailable in serving-only mode.
object checkpoint_path
ImplicitContainer<T> experimental_mode
Show Example
import tensorflow as tf 

# Create a tf.keras model. model = tf.keras.Sequential() model.add(tf.keras.layers.Dense(1, input_shape=[10])) model.summary()

# Save the tf.keras model in the SavedModel format. path = '/tmp/simple_keras_model' tf.keras.experimental.export_saved_model(model, path)

# Load the saved keras model back. new_model = tf.keras.experimental.load_from_saved_model(path) new_model.summary()

object train(string input_fn, int hooks, string steps, int max_steps, string saving_listeners)

object train(string input_fn, int hooks, string steps, string max_steps, string saving_listeners)

object train(string input_fn, object hooks, int steps, int max_steps, string saving_listeners)

Public static methods

RNNEstimator NewDyn(object head, object sequence_feature_columns, object context_feature_columns, object num_units, ImplicitContainer<T> cell_type, object rnn_cell_fn, ImplicitContainer<T> return_sequences, object model_dir, ImplicitContainer<T> optimizer, object input_layer_partitioner, object config)

Public properties

object config get;

object config_dyn get;

object model_dir get;

object model_dir_dyn get;

object model_fn get;

object model_fn_dyn get;

object params get;

object params_dyn get;

object PythonObject get;