neulab/docprompting-conala huggingface dataset:
tf.keras.callbacks.ReduceLROnPlateau     View source on GitHub    Reduce learning rate when a metric has stopped improving. Inherits From: Callback  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.callbacks.ReduceLROnPlateau  
tf.keras.callbacks.ReduceLROnPlateau(
    monitor='val_loss', factor=0.1, patience=10, verbose=0,
    mode='auto', min_delta=0.0001, cooldown=0, min_lr=0, **kwargs
)
 Models often benefit from reducing the learning rate by a factor of 2-10 once learning stagnates. This callback monitors a quantity and if no improvement is seen for a 'patience' number of epochs, the learning rate is reduced. Example: reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=0.2,
                              patience=5, min_lr=0.001)
model.fit(X_train, Y_train, callbacks=[reduce_lr])

 


 Arguments
  monitor   quantity to be monitored.  
  factor   factor by which the learning rate will be reduced. new_lr = lr * factor.  
  patience   number of epochs with no improvement after which learning rate will be reduced.  
  verbose   int. 0: quiet, 1: update messages.  
  mode   one of {'auto', 'min', 'max'}. In 'min' mode, the learning rate will be reduced when the quantity monitored has stopped decreasing; in 'max' mode it will be reduced when the quantity monitored has stopped increasing; in 'auto' mode, the direction is automatically inferred from the name of the monitored quantity.  
  min_delta   threshold for measuring the new optimum, to only focus on significant changes.  
  cooldown   number of epochs to wait before resuming normal operation after lr has been reduced.  
  min_lr   lower bound on the learning rate.    Methods in_cooldown View source 
in_cooldown()
 set_model View source 
set_model(
    model
)
 set_params View source 
set_params(
    params
)
tf.keras.callbacks.RemoteMonitor     View source on GitHub    Callback used to stream events to a server. Inherits From: Callback  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.callbacks.RemoteMonitor  
tf.keras.callbacks.RemoteMonitor(
    root='http://localhost:9000', path='/publish/epoch/end/',
    field='data', headers=None, send_as_json=False
)
 Requires the requests library. Events are sent to root + '/publish/epoch/end/' by default. Calls are HTTP POST, with a data argument which is a JSON-encoded dictionary of event data. If send_as_json=True, the content type of the request will be "application/json". Otherwise the serialized JSON will be sent within a form.
 


 Arguments
  root   String; root url of the target server.  
  path   String; path relative to root to which the events will be sent.  
  field   String; JSON field under which the data will be stored. The field is used only if the payload is sent within a form (i.e. send_as_json is set to False).  
  headers   Dictionary; optional custom HTTP headers.  
  send_as_json   Boolean; whether the request should be sent as "application/json".    Methods set_model View source 
set_model(
    model
)
 set_params View source 
set_params(
    params
)
tf.keras.callbacks.TerminateOnNaN     View source on GitHub    Callback that terminates training when a NaN loss is encountered. Inherits From: Callback  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.callbacks.TerminateOnNaN  
tf.keras.callbacks.TerminateOnNaN()
 Methods set_model View source 
set_model(
    model
)
 set_params View source 
set_params(
    params
)
Module: tf.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(...)
tf.keras.constraints.Constraint     View source on GitHub     View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.constraints.Constraint  Methods get_config View source 
get_config()
 __call__ View source 
__call__(
    w
)
 Call self as a function.
tf.keras.constraints.deserialize     View source on GitHub     View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.constraints.deserialize  
tf.keras.constraints.deserialize(
    config, custom_objects=None
)
tf.keras.constraints.get     View source on GitHub     View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.constraints.get  
tf.keras.constraints.get(
    identifier
)
tf.keras.constraints.MaxNorm     View source on GitHub    MaxNorm weight constraint. Inherits From: Constraint  View aliases  Main aliases 
tf.keras.constraints.max_norm Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.constraints.MaxNorm, tf.compat.v1.keras.constraints.max_norm  
tf.keras.constraints.MaxNorm(
    max_value=2, axis=0
)
 Constrains the weights incident to each hidden unit to have a norm less than or equal to a desired value. Also available via the shortcut function tf.keras.constraints.max_norm.
 


 Arguments
  max_value   the maximum norm value for the incoming weights.  
  axis   integer, axis along which to calculate weight norms. For instance, in a Dense layer the weight matrix has shape (input_dim, output_dim), set axis to 0 to constrain each weight vector of length (input_dim,). In a Conv2D layer with data_format="channels_last", the weight tensor has shape (rows, cols, input_depth, output_depth), set axis to [0, 1, 2] to constrain the weights of each filter tensor of size (rows, cols, input_depth).
tf.keras.constraints.MinMaxNorm     View source on GitHub    MinMaxNorm weight constraint. Inherits From: Constraint  View aliases  Main aliases 
tf.keras.constraints.min_max_norm Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.constraints.MinMaxNorm, tf.compat.v1.keras.constraints.min_max_norm  
tf.keras.constraints.MinMaxNorm(
    min_value=0.0, max_value=1.0, rate=1.0, axis=0
)
 Constrains the weights incident to each hidden unit to have the norm between a lower bound and an upper bound. Also available via the shortcut function tf.keras.constraints.min_max_norm.
 


 Arguments
  min_value   the minimum norm for the incoming weights.  
  max_value   the maximum norm for the incoming weights.  
  rate   rate for enforcing the constraint: weights will be rescaled to yield (1 - rate) * norm + rate * norm.clip(min_value, max_value). Effectively, this means that rate=1.0 stands for strict enforcement of the constraint, while rate<1.0 means that weights will be rescaled at each step to slowly move towards a value inside the desired interval.  
  axis   integer, axis along which to calculate weight norms. For instance, in a Dense layer the weight matrix has shape (input_dim, output_dim), set axis to 0 to constrain each weight vector of length (input_dim,). In a Conv2D layer with data_format="channels_last", the weight tensor has shape (rows, cols, input_depth, output_depth), set axis to [0, 1, 2] to constrain the weights of each filter tensor of size (rows, cols, input_depth).
tf.keras.constraints.NonNeg     View source on GitHub    Constrains the weights to be non-negative. Inherits From: Constraint  View aliases  Main aliases 
tf.keras.constraints.non_neg Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.constraints.NonNeg, tf.compat.v1.keras.constraints.non_neg  Also available via the shortcut function tf.keras.constraints.non_neg. Methods get_config View source 
get_config()
 __call__ View source 
__call__(
    w
)
 Call self as a function.
tf.keras.constraints.RadialConstraint     View source on GitHub    Constrains Conv2D kernel weights to be the same for each radius. Inherits From: Constraint  View aliases  Main aliases 
tf.keras.constraints.radial_constraint Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.constraints.RadialConstraint, tf.compat.v1.keras.constraints.radial_constraint  Also available via the shortcut function tf.keras.constraints.radial_constraint. For example, the desired output for the following 4-by-4 kernel: kernel = [[v_00, v_01, v_02, v_03],
          [v_10, v_11, v_12, v_13],
          [v_20, v_21, v_22, v_23],
          [v_30, v_31, v_32, v_33]]
 is this:: kernel = [[v_11, v_11, v_11, v_11],
          [v_11, v_33, v_33, v_11],
          [v_11, v_33, v_33, v_11],
          [v_11, v_11, v_11, v_11]]
 This constraint can be applied to any Conv2D layer version, including Conv2DTranspose and SeparableConv2D, and with either "channels_last" or "channels_first" data format. The method assumes the weight tensor is of shape (rows, cols, input_depth, output_depth). Methods get_config View source 
get_config()
tf.keras.constraints.serialize     View source on GitHub     View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.constraints.serialize  
tf.keras.constraints.serialize(
    constraint
)
tf.keras.constraints.UnitNorm     View source on GitHub    Constrains the weights incident to each hidden unit to have unit norm. Inherits From: Constraint  View aliases  Main aliases 
tf.keras.constraints.unit_norm Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.constraints.UnitNorm, tf.compat.v1.keras.constraints.unit_norm  
tf.keras.constraints.UnitNorm(
    axis=0
)
 Also available via the shortcut function tf.keras.constraints.unit_norm.
 


 Arguments
  axis   integer, axis along which to calculate weight norms. For instance, in a Dense layer the weight matrix has shape (input_dim, output_dim), set axis to 0 to constrain each weight vector of length (input_dim,). In a Conv2D layer with data_format="channels_last", the weight tensor has shape (rows, cols, input_depth, output_depth), set axis to [0, 1, 2] to constrain the weights of each filter tensor of size (rows, cols, input_depth).
Module: tf.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.keras.datasets.boston_housing Boston housing price regression dataset. Functions load_data(...): Loads the Boston Housing dataset.
tf.keras.datasets.boston_housing.load_data       View source on GitHub    Loads the Boston Housing dataset.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.datasets.boston_housing.load_data  
tf.keras.datasets.boston_housing.load_data(
    path='boston_housing.npz', test_split=0.2, seed=113
)
 This is a dataset taken from the StatLib library which is maintained at Carnegie Mellon University. Samples contain 13 attributes of houses at different locations around the Boston suburbs in the late 1970s. Targets are the median values of the houses at a location (in k$). The attributes themselves are defined in the StatLib website.
 


 Arguments
  path   path where to cache the dataset locally (relative to ~/.keras/datasets).  
  test_split   fraction of the data to reserve as test set.  
  seed   Random seed for shuffling the data before computing the test split.   
 


 Returns   Tuple of Numpy arrays: (x_train, y_train), (x_test, y_test). x_train, x_test: numpy arrays with shape (num_samples, 13) containing either the training samples (for x_train), or test samples (for y_train). y_train, y_test: numpy arrays of shape (num_samples,) containing the target scalars. The targets are float scalars typically between 10 and 50 that represent the home prices in k$.
Module: tf.keras.datasets.cifar10 CIFAR10 small images classification dataset. Functions load_data(...): Loads CIFAR10 dataset.
tf.keras.datasets.cifar10.load_data     View source on GitHub    Loads CIFAR10 dataset.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.datasets.cifar10.load_data  
tf.keras.datasets.cifar10.load_data()
 This is a dataset of 50,000 32x32 color training images and 10,000 test images, labeled over 10 categories. See more info at the CIFAR homepage.
 


 Returns   Tuple of Numpy arrays: (x_train, y_train), (x_test, y_test). x_train, x_test: uint8 arrays of RGB image data with shape (num_samples, 3, 32, 32) if tf.keras.backend.image_data_format() is 'channels_first', or (num_samples, 32, 32, 3) if the data format is 'channels_last'. y_train, y_test: uint8 arrays of category labels (integers in range 0-9) each with shape (num_samples, 1).
Module: tf.keras.datasets.cifar100 CIFAR100 small images classification dataset. Functions load_data(...): Loads CIFAR100 dataset.
tf.keras.datasets.cifar100.load_data     View source on GitHub    Loads CIFAR100 dataset.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.datasets.cifar100.load_data  
tf.keras.datasets.cifar100.load_data(
    label_mode='fine'
)
 This is a dataset of 50,000 32x32 color training images and 10,000 test images, labeled over 100 fine-grained classes that are grouped into 20 coarse-grained classes. See more info at the CIFAR homepage.
 


 Arguments
  label_mode   one of "fine", "coarse". If it is "fine" the category labels are the fine-grained labels, if it is "coarse" the output labels are the coarse-grained superclasses.   
 


 Returns   Tuple of Numpy arrays: (x_train, y_train), (x_test, y_test). x_train, x_test: uint8 arrays of RGB image data with shape (num_samples, 3, 32, 32) if tf.keras.backend.image_data_format() is 'channels_first', or (num_samples, 32, 32, 3) if the data format is 'channels_last'. y_train, y_test: uint8 arrays of category labels with shape (num_samples, 1). 
 

 


 Raises
  ValueError   in case of invalid label_mode.
Module: tf.keras.datasets.fashion_mnist Fashion-MNIST dataset. Functions load_data(...): Loads the Fashion-MNIST dataset.
tf.keras.datasets.fashion_mnist.load_data     View source on GitHub    Loads the Fashion-MNIST dataset.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.datasets.fashion_mnist.load_data  
tf.keras.datasets.fashion_mnist.load_data()
 This is a dataset of 60,000 28x28 grayscale images of 10 fashion categories, along with a test set of 10,000 images. This dataset can be used as a drop-in replacement for MNIST. The class labels are:    Label Description     0 T-shirt/top   1 Trouser   2 Pullover   3 Dress   4 Coat   5 Sandal   6 Shirt   7 Sneaker   8 Bag   9 Ankle boot   
 


 Returns   Tuple of Numpy arrays: (x_train, y_train), (x_test, y_test). x_train, x_test: uint8 arrays of grayscale image data with shape (num_samples, 28, 28). y_train, y_test: uint8 arrays of labels (integers in range 0-9) with shape (num_samples,). 
 
 License: The copyright for Fashion-MNIST is held by Zalando SE. Fashion-MNIST is licensed under the MIT license.
Module: tf.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.
tf.keras.datasets.imdb.get_word_index     View source on GitHub    Retrieves a dict mapping words to their index in the IMDB dataset.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.datasets.imdb.get_word_index  
tf.keras.datasets.imdb.get_word_index(
    path='imdb_word_index.json'
)

 


 Arguments
  path   where to cache the data (relative to ~/.keras/dataset).   
 


 Returns   The word index dictionary. Keys are word strings, values are their index.
tf.keras.datasets.imdb.load_data     View source on GitHub    Loads the IMDB dataset.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.datasets.imdb.load_data  
tf.keras.datasets.imdb.load_data(
    path='imdb.npz', num_words=None, skip_top=0, maxlen=None, seed=113,
    start_char=1, oov_char=2, index_from=3, **kwargs
)
 This is a dataset of 25,000 movies reviews from IMDB, labeled by sentiment (positive/negative). Reviews have been preprocessed, and each review is encoded as a list of word indexes (integers). For convenience, words are indexed by overall frequency in the dataset, so that for instance the integer "3" encodes the 3rd most frequent word in the data. This allows for quick filtering operations such as: "only consider the top 10,000 most common words, but eliminate the top 20 most common words". As a convention, "0" does not stand for a specific word, but instead is used to encode any unknown word.
 


 Arguments
  path   where to cache the data (relative to ~/.keras/dataset).  
  num_words   integer or None. Words are ranked by how often they occur (in the training set) and only the num_words most frequent words are kept. Any less frequent word will appear as oov_char value in the sequence data. If None, all words are kept. Defaults to None, so all words are kept.  
  skip_top   skip the top N most frequently occurring words (which may not be informative). These words will appear as oov_char value in the dataset. Defaults to 0, so no words are skipped.  
  maxlen   int or None. Maximum sequence length. Any longer sequence will be truncated. Defaults to None, which means no truncation.  
  seed   int. Seed for reproducible data shuffling.  
  start_char   int. The start of a sequence will be marked with this character. Defaults to 1 because 0 is usually the padding character.  
  oov_char   int. The out-of-vocabulary character. Words that were cut out because of the num_words or skip_top limits will be replaced with this character.  
  index_from   int. Index actual words with this index and higher.  
  **kwargs   Used for backwards compatibility.   
 


 Returns   Tuple of Numpy arrays: (x_train, y_train), (x_test, y_test). x_train, x_test: lists of sequences, which are lists of indexes (integers). If the num_words argument was specific, the maximum possible index value is num_words - 1. If the maxlen argument was specified, the largest possible sequence length is maxlen. y_train, y_test: lists of integer labels (1 or 0). 
 

 


 Raises
  ValueError   in case maxlen is so low that no input sequence could be kept.    Note that the 'out of vocabulary' character is only used for words that were present in the training set but are not included because they're not making the num_words cut here. Words that were not seen in the training set but are in the test set have simply been skipped.
Module: tf.keras.datasets.mnist MNIST handwritten digits dataset. Functions load_data(...): Loads the MNIST dataset.
tf.keras.datasets.mnist.load_data     View source on GitHub    Loads the MNIST dataset.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.datasets.mnist.load_data  
tf.keras.datasets.mnist.load_data(
    path='mnist.npz'
)
 This is a dataset of 60,000 28x28 grayscale images of the 10 digits, along with a test set of 10,000 images. More info can be found at the MNIST homepage.
 


 Arguments
  path   path where to cache the dataset locally (relative to ~/.keras/datasets).   
 


 Returns   Tuple of Numpy arrays: (x_train, y_train), (x_test, y_test). x_train, x_test: uint8 arrays of grayscale image data with shapes (num_samples, 28, 28). y_train, y_test: uint8 arrays of digit labels (integers in range 0-9) with shapes (num_samples,). 
 
 License: Yann LeCun and Corinna Cortes hold the copyright of MNIST dataset, which is a derivative work from original NIST datasets. MNIST dataset is made available under the terms of the Creative Commons Attribution-Share Alike 3.0 license.
Module: tf.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.
tf.keras.datasets.reuters.get_word_index     View source on GitHub    Retrieves a dict mapping words to their index in the Reuters dataset.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.datasets.reuters.get_word_index  
tf.keras.datasets.reuters.get_word_index(
    path='reuters_word_index.json'
)

 


 Arguments
  path   where to cache the data (relative to ~/.keras/dataset).   
 


 Returns   The word index dictionary. Keys are word strings, values are their index.