neulab/docprompting-conala huggingface dataset:
Module: tf.compat.v1.keras.backend Keras backend API. Classes class name_scope: A context manager for use when defining a Python op. Functions clear_session(...): Resets all state generated by Keras. epsilon(...): Returns the value of the fuzz factor used in numeric expressions. floatx(...): Returns the default float type, as a string. get_session(...): Returns the TF session to be used by the backend. get_uid(...): Associates a string prefix with an integer counter in a TensorFlow graph. image_data_format(...): Returns the default image data format convention. is_keras_tensor(...): Returns whether x is a Keras tensor. reset_uids(...): Resets graph identifiers. rnn(...): Iterates over the time dimension of a tensor. set_epsilon(...): Sets the value of the fuzz factor used in numeric expressions. set_floatx(...): Sets the default float type. set_image_data_format(...): Sets the value of the image data format convention. set_session(...): Sets the global TensorFlow session.
tf.compat.v1.keras.backend.get_session Returns the TF session to be used by the backend. 
tf.compat.v1.keras.backend.get_session(
    op_input_list=()
)
 If a default TensorFlow session is available, we will return it. Else, we will return the global Keras session assuming it matches the current graph. If no global Keras session exists at this point: we will create a new global session. Note that you can manually set the global session via K.set_session(sess).
 


 Arguments
  op_input_list   An option sequence of tensors or ops, which will be used to determine the current graph. Otherwise the default graph will be used.   
 


 Returns   A TensorFlow session.
tf.compat.v1.keras.backend.name_scope A context manager for use when defining a Python op.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.name_scope  
tf.compat.v1.keras.backend.name_scope(
    name, default_name=None, values=None
)
 This context manager validates that the given values are from the same graph, makes that graph the default graph, and pushes a name scope in that graph (see tf.Graph.name_scope for more details on that). For example, to define a new Python op called my_op: def my_op(a, b, c, name=None):
  with tf.name_scope(name, "MyOp", [a, b, c]) as scope:
    a = tf.convert_to_tensor(a, name="a")
    b = tf.convert_to_tensor(b, name="b")
    c = tf.convert_to_tensor(c, name="c")
    # Define some computation that uses `a`, `b`, and `c`.
    return foo_op(..., name=scope)

 


 Args
  name   The name argument that is passed to the op function.  
  default_name   The default name to use if the name argument is None.  
  values   The list of Tensor arguments that are passed to the op function.   
 


 Raises
  TypeError   if default_name is passed in but not a string.   
 


 Attributes
  name  
   Methods __enter__ View source 
__enter__()
 __exit__ View source 
__exit__(
    *exc_info
)
tf.compat.v1.keras.backend.set_session Sets the global TensorFlow session. 
tf.compat.v1.keras.backend.set_session(
    session
)

 


 Arguments
  session   A TF Session.
Module: tf.compat.v1.keras.callbacks Callbacks: utilities called at certain points during model training. Classes class BaseLogger: Callback that accumulates epoch averages of metrics. class CSVLogger: Callback that streams epoch results to a CSV file. class Callback: Abstract base class used to build new callbacks. class CallbackList: Container abstracting a list of callbacks. class EarlyStopping: Stop training when a monitored metric has stopped improving. class History: Callback that records events into a History object. class LambdaCallback: Callback for creating simple, custom callbacks on-the-fly. class LearningRateScheduler: Learning rate scheduler. class ModelCheckpoint: Callback to save the Keras model or model weights at some frequency. class ProgbarLogger: Callback that prints metrics to stdout. class ReduceLROnPlateau: Reduce learning rate when a metric has stopped improving. class RemoteMonitor: Callback used to stream events to a server. class TensorBoard: Enable visualizations for TensorBoard. class TerminateOnNaN: Callback that terminates training when a NaN loss is encountered.
Module: tf.compat.v1.keras.constraints Constraints: functions that impose constraints on weight values. Classes class Constraint class MaxNorm: MaxNorm weight constraint. class MinMaxNorm: MinMaxNorm weight constraint. class NonNeg: Constrains the weights to be non-negative. class RadialConstraint: Constrains Conv2D kernel weights to be the same for each radius. class UnitNorm: Constrains the weights incident to each hidden unit to have unit norm. class max_norm: MaxNorm weight constraint. class min_max_norm: MinMaxNorm weight constraint. class non_neg: Constrains the weights to be non-negative. class radial_constraint: Constrains Conv2D kernel weights to be the same for each radius. class unit_norm: Constrains the weights incident to each hidden unit to have unit norm. Functions deserialize(...) get(...) serialize(...)
Module: tf.compat.v1.keras.datasets Public API for tf.keras.datasets namespace. Modules boston_housing module: Boston housing price regression dataset. cifar10 module: CIFAR10 small images classification dataset. cifar100 module: CIFAR100 small images classification dataset. fashion_mnist module: Fashion-MNIST dataset. imdb module: IMDB sentiment classification dataset. mnist module: MNIST handwritten digits dataset. reuters module: Reuters topic classification dataset.
Module: tf.compat.v1.keras.datasets.boston_housing Boston housing price regression dataset. Functions load_data(...): Loads the Boston Housing dataset.
Module: tf.compat.v1.keras.datasets.cifar10 CIFAR10 small images classification dataset. Functions load_data(...): Loads CIFAR10 dataset.
Module: tf.compat.v1.keras.datasets.cifar100 CIFAR100 small images classification dataset. Functions load_data(...): Loads CIFAR100 dataset.
Module: tf.compat.v1.keras.datasets.fashion_mnist Fashion-MNIST dataset. Functions load_data(...): Loads the Fashion-MNIST dataset.
Module: tf.compat.v1.keras.datasets.imdb IMDB sentiment classification dataset. Functions get_word_index(...): Retrieves a dict mapping words to their index in the IMDB dataset. load_data(...): Loads the IMDB dataset.
Module: tf.compat.v1.keras.datasets.mnist MNIST handwritten digits dataset. Functions load_data(...): Loads the MNIST dataset.
Module: tf.compat.v1.keras.datasets.reuters Reuters topic classification dataset. Functions get_word_index(...): Retrieves a dict mapping words to their index in the Reuters dataset. load_data(...): Loads the Reuters newswire classification dataset.
Module: tf.compat.v1.keras.estimator Keras estimator API. Functions model_to_estimator(...): Constructs an Estimator instance from given keras model.
Module: tf.compat.v1.keras.experimental Public API for tf.keras.experimental namespace. Classes class CosineDecay: A LearningRateSchedule that uses a cosine decay schedule. class CosineDecayRestarts: A LearningRateSchedule that uses a cosine decay schedule with restarts. class LinearCosineDecay: A LearningRateSchedule that uses a linear cosine decay schedule. class LinearModel: Linear Model for regression and classification problems. class NoisyLinearCosineDecay: A LearningRateSchedule that uses a noisy linear cosine decay schedule. class PeepholeLSTMCell: Equivalent to LSTMCell class but adds peephole connections. class SequenceFeatures: A layer for sequence input. class WideDeepModel: Wide & Deep Model for regression and classification problems. Functions export_saved_model(...): Exports a tf.keras.Model as a Tensorflow SavedModel. load_from_saved_model(...): Loads a keras Model from a SavedModel created by export_saved_model().
tf.compat.v1.keras.experimental.export_saved_model Exports a tf.keras.Model as a Tensorflow SavedModel. 
tf.compat.v1.keras.experimental.export_saved_model(
    model, saved_model_path, custom_objects=None, as_text=False,
    input_signature=None, serving_only=False
)
 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:  a checkpoint containing the model weights. 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. 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: 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()

 


 Args
  model   A tf.keras.Model to be saved. If the model is subclassed, the flag serving_only must be set to True.  
  saved_model_path   a string specifying the path to the SavedModel directory.  
  custom_objects   Optional dictionary mapping string names to custom classes or functions (e.g. custom loss functions).  
  as_text   bool, False by default. Whether to write the SavedModel proto in text format. Currently unavailable in serving-only mode.  
  input_signature   A possibly nested sequence of tf.TensorSpec objects, used to specify the expected model inputs. See tf.function for more details.  
  serving_only   bool, False by default. When this is true, only the prediction graph is saved.   
 


 Raises
  NotImplementedError   If the model is a subclassed model, and serving_only is False.  
  ValueError   If the input signature cannot be inferred from the model.  
  AssertionError   If the SavedModel directory already exists and isn't empty.
tf.compat.v1.keras.experimental.load_from_saved_model Loads a keras Model from a SavedModel created by export_saved_model(). 
tf.compat.v1.keras.experimental.load_from_saved_model(
    saved_model_path, custom_objects=None
)
 This function reinstantiates model state by: 1) loading model topology from json (this will eventually come from metagraph). 2) loading model weights from checkpoint. 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()

 


 Args
  saved_model_path   a string specifying the path to an existing SavedModel.  
  custom_objects   Optional dictionary mapping names (strings) to custom classes or functions to be considered during deserialization.   
 


 Returns   a keras.Model instance.
Module: tf.compat.v1.keras.initializers Keras initializer serialization / deserialization. Classes class Constant: Initializer that generates tensors with constant values. class Identity: Initializer that generates the identity matrix. class Initializer: Initializer base class: all Keras initializers inherit from this class. class Ones: Initializer that generates tensors initialized to 1. class Orthogonal: Initializer that generates an orthogonal matrix. class RandomNormal: Initializer that generates tensors with a normal distribution. class RandomUniform: Initializer that generates tensors with a uniform distribution. class TruncatedNormal: Initializer that generates a truncated normal distribution. class VarianceScaling: Initializer capable of adapting its scale to the shape of weights tensors. class Zeros: Initializer that generates tensors initialized to 0. class constant: Initializer that generates tensors with constant values. class glorot_normal: The Glorot normal initializer, also called Xavier normal initializer. class glorot_uniform: The Glorot uniform initializer, also called Xavier uniform initializer. class he_normal: Initializer capable of adapting its scale to the shape of weights tensors. class he_uniform: Initializer capable of adapting its scale to the shape of weights tensors. class identity: Initializer that generates the identity matrix. class lecun_normal: Initializer capable of adapting its scale to the shape of weights tensors. class lecun_uniform: Initializer capable of adapting its scale to the shape of weights tensors. class normal: Initializer that generates tensors with a normal distribution. class ones: Initializer that generates tensors initialized to 1. class orthogonal: Initializer that generates an orthogonal matrix. class random_normal: Initializer that generates tensors with a normal distribution. class random_uniform: Initializer that generates tensors with a uniform distribution. class truncated_normal: Initializer that generates a truncated normal distribution. class uniform: Initializer that generates tensors with a uniform distribution. class zeros: Initializer that generates tensors initialized to 0. Functions deserialize(...): Return an Initializer object from its config. get(...) serialize(...)
tf.compat.v1.keras.initializers.glorot_normal The Glorot normal initializer, also called Xavier normal initializer. Inherits From: VarianceScaling  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.glorot_normal_initializer, tf.compat.v1.initializers.glorot_normal  
tf.compat.v1.keras.initializers.glorot_normal(
    seed=None, dtype=tf.dtypes.float32
)
 It draws samples from a truncated normal distribution centered on 0 with standard deviation (after truncation) given by stddev = sqrt(2 / (fan_in + fan_out)) where fan_in is the number of input units in the weight tensor and fan_out is the number of output units in the weight tensor.
 


 Args
  seed   A Python integer. Used to create random seeds. See tf.compat.v1.set_random_seed for behavior.  
  dtype   Default data type, used if no dtype argument is provided when calling the initializer. Only floating point types are supported.    References: Glorot et al., 2010 (pdf) Methods from_config View source 
@classmethod
from_config(
    config
)
 Instantiates an initializer from a configuration dictionary. Example: initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

 


 Args
  config   A Python dictionary. It will typically be the output of get_config.   
 


 Returns   An Initializer instance.  
 get_config View source 
get_config()
 Returns the configuration of the initializer as a JSON-serializable dict.
 


 Returns   A JSON-serializable Python dict.  
 __call__ View source 
__call__(
    shape, dtype=None, partition_info=None
)
 Returns a tensor object initialized as specified by the initializer.
 


 Args
  shape   Shape of the tensor.  
  dtype   Optional dtype of the tensor. If not provided use the initializer dtype.  
  partition_info   Optional information about the possible partitioning of a tensor.
tf.compat.v1.keras.initializers.glorot_uniform The Glorot uniform initializer, also called Xavier uniform initializer. Inherits From: VarianceScaling  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.glorot_uniform_initializer, tf.compat.v1.initializers.glorot_uniform  
tf.compat.v1.keras.initializers.glorot_uniform(
    seed=None, dtype=tf.dtypes.float32
)
 It draws samples from a uniform distribution within [-limit, limit] where limit is sqrt(6 / (fan_in + fan_out)) where fan_in is the number of input units in the weight tensor and fan_out is the number of output units in the weight tensor.
 


 Args
  seed   A Python integer. Used to create random seeds. See tf.compat.v1.set_random_seed for behavior.  
  dtype   Default data type, used if no dtype argument is provided when calling the initializer. Only floating point types are supported.    References: Glorot et al., 2010 (pdf) Methods from_config View source 
@classmethod
from_config(
    config
)
 Instantiates an initializer from a configuration dictionary. Example: initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

 


 Args
  config   A Python dictionary. It will typically be the output of get_config.   
 


 Returns   An Initializer instance.  
 get_config View source 
get_config()
 Returns the configuration of the initializer as a JSON-serializable dict.
 


 Returns   A JSON-serializable Python dict.  
 __call__ View source 
__call__(
    shape, dtype=None, partition_info=None
)
 Returns a tensor object initialized as specified by the initializer.
 


 Args
  shape   Shape of the tensor.  
  dtype   Optional dtype of the tensor. If not provided use the initializer dtype.  
  partition_info   Optional information about the possible partitioning of a tensor.
tf.compat.v1.keras.initializers.he_normal Initializer capable of adapting its scale to the shape of weights tensors. Inherits From: VarianceScaling 
tf.compat.v1.keras.initializers.he_normal(
    seed=None
)
 With distribution="truncated_normal" or "untruncated_normal", samples are drawn from a truncated/untruncated normal distribution with a mean of zero and a standard deviation (after truncation, if used) stddev = sqrt(scale / n) where n is:  number of input units in the weight tensor, if mode = "fan_in" number of output units, if mode = "fan_out" average of the numbers of input and output units, if mode = "fan_avg"  With distribution="uniform", samples are drawn from a uniform distribution within [-limit, limit], with limit = sqrt(3 * scale / n).
 


 Args
  scale   Scaling factor (positive float).  
  mode   One of "fan_in", "fan_out", "fan_avg".  
  distribution   Random distribution to use. One of "normal", "uniform".  
  seed   A Python integer. Used to create random seeds. See tf.compat.v1.set_random_seed for behavior.  
  dtype   Default data type, used if no dtype argument is provided when calling the initializer. Only floating point types are supported.   
 


 Raises
  ValueError   In case of an invalid value for the "scale", mode" or "distribution" arguments.    Methods from_config View source 
@classmethod
from_config(
    config
)
 Instantiates an initializer from a configuration dictionary. Example: initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

 


 Args
  config   A Python dictionary. It will typically be the output of get_config.   
 


 Returns   An Initializer instance.  
 get_config View source 
get_config()
 Returns the configuration of the initializer as a JSON-serializable dict.
 


 Returns   A JSON-serializable Python dict.  
 __call__ View source 
__call__(
    shape, dtype=None, partition_info=None
)
 Returns a tensor object initialized as specified by the initializer.
 


 Args
  shape   Shape of the tensor.  
  dtype   Optional dtype of the tensor. If not provided use the initializer dtype.  
  partition_info   Optional information about the possible partitioning of a tensor.
tf.compat.v1.keras.initializers.he_uniform Initializer capable of adapting its scale to the shape of weights tensors. Inherits From: VarianceScaling 
tf.compat.v1.keras.initializers.he_uniform(
    seed=None
)
 With distribution="truncated_normal" or "untruncated_normal", samples are drawn from a truncated/untruncated normal distribution with a mean of zero and a standard deviation (after truncation, if used) stddev = sqrt(scale / n) where n is:  number of input units in the weight tensor, if mode = "fan_in" number of output units, if mode = "fan_out" average of the numbers of input and output units, if mode = "fan_avg"  With distribution="uniform", samples are drawn from a uniform distribution within [-limit, limit], with limit = sqrt(3 * scale / n).
 


 Args
  scale   Scaling factor (positive float).  
  mode   One of "fan_in", "fan_out", "fan_avg".  
  distribution   Random distribution to use. One of "normal", "uniform".  
  seed   A Python integer. Used to create random seeds. See tf.compat.v1.set_random_seed for behavior.  
  dtype   Default data type, used if no dtype argument is provided when calling the initializer. Only floating point types are supported.   
 


 Raises
  ValueError   In case of an invalid value for the "scale", mode" or "distribution" arguments.    Methods from_config View source 
@classmethod
from_config(
    config
)
 Instantiates an initializer from a configuration dictionary. Example: initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

 


 Args
  config   A Python dictionary. It will typically be the output of get_config.   
 


 Returns   An Initializer instance.  
 get_config View source 
get_config()
 Returns the configuration of the initializer as a JSON-serializable dict.
 


 Returns   A JSON-serializable Python dict.  
 __call__ View source 
__call__(
    shape, dtype=None, partition_info=None
)
 Returns a tensor object initialized as specified by the initializer.
 


 Args
  shape   Shape of the tensor.  
  dtype   Optional dtype of the tensor. If not provided use the initializer dtype.  
  partition_info   Optional information about the possible partitioning of a tensor.
tf.compat.v1.keras.initializers.Identity Initializer that generates the identity matrix.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.initializers.identity, tf.compat.v1.keras.initializers.identity  
tf.compat.v1.keras.initializers.Identity(
    gain=1.0, dtype=tf.dtypes.float32
)
 Only use for 2D matrices.
 


 Args
  gain   Multiplicative factor to apply to the identity matrix.  
  dtype   Default data type, used if no dtype argument is provided when calling the initializer. Only floating point types are supported.    Methods from_config View source 
@classmethod
from_config(
    config
)
 Instantiates an initializer from a configuration dictionary. Example: initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

 


 Args
  config   A Python dictionary. It will typically be the output of get_config.   
 


 Returns   An Initializer instance.  
 get_config View source 
get_config()
 Returns the configuration of the initializer as a JSON-serializable dict.
 


 Returns   A JSON-serializable Python dict.  
 __call__ View source 
__call__(
    shape, dtype=None, partition_info=None
)
 Returns a tensor object initialized as specified by the initializer.
 


 Args
  shape   Shape of the tensor.  
  dtype   Optional dtype of the tensor. If not provided use the initializer dtype.  
  partition_info   Optional information about the possible partitioning of a tensor.