neulab/docprompting-conala huggingface dataset:
tf.keras.activations.softmax     View source on GitHub    Softmax converts a real vector to a vector of categorical probabilities.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.activations.softmax  
tf.keras.activations.softmax(
    x, axis=-1
)
 The elements of the output vector are in range (0, 1) and sum to 1. Each vector is handled independently. The axis argument sets which axis of the input the function is applied along. Softmax is often used as the activation for the last layer of a classification network because the result could be interpreted as a probability distribution. The softmax of each vector x is computed as exp(x) / tf.reduce_sum(exp(x)). The input values in are the log-odds of the resulting probability.
 


 Arguments
  x   Input tensor.  
  axis   Integer, axis along which the softmax normalization is applied.   
 


 Returns   Tensor, output of softmax transformation (all values are non-negative and sum to 1).  

 


 Raises
  ValueError   In case dim(x) == 1.
tf.keras.activations.softplus     View source on GitHub    Softplus activation function, softplus(x) = log(exp(x) + 1).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.activations.softplus  
tf.keras.activations.softplus(
    x
)
 Example Usage: 
a = tf.constant([-20, -1.0, 0.0, 1.0, 20], dtype = tf.float32)
b = tf.keras.activations.softplus(a)
b.numpy()
array([2.0611537e-09, 3.1326166e-01, 6.9314718e-01, 1.3132616e+00,
         2.0000000e+01], dtype=float32)

 


 Arguments
  x   Input tensor.   
 


 Returns   The softplus activation: log(exp(x) + 1).
tf.keras.activations.softsign     View source on GitHub    Softsign activation function, softsign(x) = x / (abs(x) + 1).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.activations.softsign  
tf.keras.activations.softsign(
    x
)
 Example Usage: 
a = tf.constant([-1.0, 0.0, 1.0], dtype = tf.float32)
b = tf.keras.activations.softsign(a)
b.numpy()
array([-0.5,  0. ,  0.5], dtype=float32)

 


 Arguments
  x   Input tensor.   
 


 Returns   The softsign activation: x / (abs(x) + 1).
tf.keras.activations.swish Swish activation function, swish(x) = x * sigmoid(x).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.activations.swish  
tf.keras.activations.swish(
    x
)
 Swish activation function which returns x*sigmoid(x). It is a smooth, non-monotonic function that consistently matches or outperforms ReLU on deep networks, it is unbounded above and bounded below. Example Usage: 
a = tf.constant([-20, -1.0, 0.0, 1.0, 20], dtype = tf.float32)
b = tf.keras.activations.swish(a)
b.numpy()
array([-4.1223075e-08, -2.6894143e-01,  0.0000000e+00,  7.3105860e-01,
          2.0000000e+01], dtype=float32)

 


 Arguments
  x   Input tensor.   
 


 Returns   The swish activation applied to x (see reference paper for details).  
 Reference:  Ramachandran et al., 2017
tf.keras.activations.tanh     View source on GitHub    Hyperbolic tangent activation function.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.activations.tanh  
tf.keras.activations.tanh(
    x
)
 For example: 
a = tf.constant([-3.0,-1.0, 0.0,1.0,3.0], dtype = tf.float32)
b = tf.keras.activations.tanh(a)
b.numpy()
array([-0.9950547, -0.7615942,  0.,  0.7615942,  0.9950547], dtype=float32)

 


 Arguments
  x   Input tensor.   
 


 Returns   Tensor of same shape and dtype of input x, with tanh activation: tanh(x) = sinh(x)/cosh(x) = ((exp(x) - exp(-x))/(exp(x) + exp(-x))).
Module: tf.keras.applications Keras Applications are canned architectures with pre-trained weights. Modules densenet module: DenseNet models for Keras. efficientnet module: EfficientNet models for Keras. imagenet_utils module: Utilities for ImageNet data preprocessing & prediction decoding. inception_resnet_v2 module: Inception-ResNet V2 model for Keras. inception_v3 module: Inception V3 model for Keras. mobilenet module: MobileNet v1 models for Keras. mobilenet_v2 module: MobileNet v2 models for Keras. mobilenet_v3 module: MobileNet v3 models for Keras. nasnet module: NASNet-A models for Keras. resnet module: ResNet models for Keras. resnet50 module: Public API for tf.keras.applications.resnet50 namespace. resnet_v2 module: ResNet v2 models for Keras. vgg16 module: VGG16 model for Keras. vgg19 module: VGG19 model for Keras. xception module: Xception V1 model for Keras. Functions DenseNet121(...): Instantiates the Densenet121 architecture. DenseNet169(...): Instantiates the Densenet169 architecture. DenseNet201(...): Instantiates the Densenet201 architecture. EfficientNetB0(...): Instantiates the EfficientNetB0 architecture. EfficientNetB1(...): Instantiates the EfficientNetB1 architecture. EfficientNetB2(...): Instantiates the EfficientNetB2 architecture. EfficientNetB3(...): Instantiates the EfficientNetB3 architecture. EfficientNetB4(...): Instantiates the EfficientNetB4 architecture. EfficientNetB5(...): Instantiates the EfficientNetB5 architecture. EfficientNetB6(...): Instantiates the EfficientNetB6 architecture. EfficientNetB7(...): Instantiates the EfficientNetB7 architecture. InceptionResNetV2(...): Instantiates the Inception-ResNet v2 architecture. InceptionV3(...): Instantiates the Inception v3 architecture. MobileNet(...): Instantiates the MobileNet architecture. MobileNetV2(...): Instantiates the MobileNetV2 architecture. MobileNetV3Large(...): Instantiates the MobileNetV3Large architecture. MobileNetV3Small(...): Instantiates the MobileNetV3Small architecture. NASNetLarge(...): Instantiates a NASNet model in ImageNet mode. NASNetMobile(...): Instantiates a Mobile NASNet model in ImageNet mode. ResNet101(...): Instantiates the ResNet101 architecture. ResNet101V2(...): Instantiates the ResNet101V2 architecture. ResNet152(...): Instantiates the ResNet152 architecture. ResNet152V2(...): Instantiates the ResNet152V2 architecture. ResNet50(...): Instantiates the ResNet50 architecture. ResNet50V2(...): Instantiates the ResNet50V2 architecture. VGG16(...): Instantiates the VGG16 model. VGG19(...): Instantiates the VGG19 architecture. Xception(...): Instantiates the Xception architecture.
Module: tf.keras.applications.densenet DenseNet models for Keras. Reference:  
Densely Connected Convolutional Networks (CVPR 2017)  Functions DenseNet121(...): Instantiates the Densenet121 architecture. DenseNet169(...): Instantiates the Densenet169 architecture. DenseNet201(...): Instantiates the Densenet201 architecture. decode_predictions(...): Decodes the prediction of an ImageNet model. preprocess_input(...): Preprocesses a tensor or Numpy array encoding a batch of images.
tf.keras.applications.densenet.decode_predictions     View source on GitHub    Decodes the prediction of an ImageNet model.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.applications.densenet.decode_predictions  
tf.keras.applications.densenet.decode_predictions(
    preds, top=5
)

 


 Arguments
  preds   Numpy array encoding a batch of predictions.  
  top   Integer, how many top-guesses to return. Defaults to 5.   
 


 Returns   A list of lists of top class prediction tuples (class_name, class_description, score). One list of tuples per sample in batch input.  

 


 Raises
  ValueError   In case of invalid shape of the pred array (must be 2D).
tf.keras.applications.densenet.preprocess_input     View source on GitHub    Preprocesses a tensor or Numpy array encoding a batch of images.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.applications.densenet.preprocess_input  
tf.keras.applications.densenet.preprocess_input(
    x, data_format=None
)
 Usage example with applications.MobileNet: i = tf.keras.layers.Input([None, None, 3], dtype = tf.uint8)
x = tf.cast(i, tf.float32)
x = tf.keras.applications.mobilenet.preprocess_input(x)
core = tf.keras.applications.MobileNet()
x = core(x)
model = tf.keras.Model(inputs=[i], outputs=[x])

image = tf.image.decode_png(tf.io.read_file('file.png'))
result = model(image)

 


 Arguments
  x   A floating point numpy.array or a tf.Tensor, 3D or 4D with 3 color channels, with values in the range [0, 255]. The preprocessed data are written over the input data if the data types are compatible. To avoid this behaviour, numpy.copy(x) can be used.  
  data_format   Optional data format of the image tensor/array. Defaults to None, in which case the global setting tf.keras.backend.image_data_format() is used (unless you changed it, it defaults to "channels_last").   
 


 Returns   Preprocessed numpy.array or a tf.Tensor with type float32. The input pixels values are scaled between 0 and 1 and each channel is normalized with respect to the ImageNet dataset. 
 

 


 Raises
  ValueError   In case of unknown data_format argument.
tf.keras.applications.DenseNet121     View source on GitHub    Instantiates the Densenet121 architecture.  View aliases  Main aliases 
tf.keras.applications.densenet.DenseNet121 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.DenseNet121, tf.compat.v1.keras.applications.densenet.DenseNet121  
tf.keras.applications.DenseNet121(
    include_top=True, weights='imagenet', input_tensor=None,
    input_shape=None, pooling=None, classes=1000
)
 Reference:  
Densely Connected Convolutional Networks (CVPR 2017)  Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is the one specified in your Keras config at ~/.keras/keras.json. 
Note: each Keras Application expects a specific kind of input preprocessing. For DenseNet, call tf.keras.applications.densenet.preprocess_input on your inputs before passing them to the model.

 


 Arguments
  include_top   whether to include the fully-connected layer at the top of the network.  
  weights   one of None (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded.  
  input_tensor   optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.  
  input_shape   optional shape tuple, only to be specified if include_top is False (otherwise the input shape has to be (224, 224, 3) (with 'channels_last' data format) or (3, 224, 224) (with 'channels_first' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 32. E.g. (200, 200, 3) would be one valid value.  
  pooling   Optional pooling mode for feature extraction when include_top is False.  
None means that the output of the model will be the 4D tensor output of the last convolutional block. 
avg means that global average pooling will be applied to the output of the last convolutional block, and thus the output of the model will be a 2D tensor. 
max means that global max pooling will be applied. 

 
  classes   optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified.   
 


 Returns   A Keras model instance.
tf.keras.applications.DenseNet169     View source on GitHub    Instantiates the Densenet169 architecture.  View aliases  Main aliases 
tf.keras.applications.densenet.DenseNet169 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.DenseNet169, tf.compat.v1.keras.applications.densenet.DenseNet169  
tf.keras.applications.DenseNet169(
    include_top=True, weights='imagenet', input_tensor=None,
    input_shape=None, pooling=None, classes=1000
)
 Reference:  
Densely Connected Convolutional Networks (CVPR 2017)  Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is the one specified in your Keras config at ~/.keras/keras.json. 
Note: each Keras Application expects a specific kind of input preprocessing. For DenseNet, call tf.keras.applications.densenet.preprocess_input on your inputs before passing them to the model.

 


 Arguments
  include_top   whether to include the fully-connected layer at the top of the network.  
  weights   one of None (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded.  
  input_tensor   optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.  
  input_shape   optional shape tuple, only to be specified if include_top is False (otherwise the input shape has to be (224, 224, 3) (with 'channels_last' data format) or (3, 224, 224) (with 'channels_first' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 32. E.g. (200, 200, 3) would be one valid value.  
  pooling   Optional pooling mode for feature extraction when include_top is False.  
None means that the output of the model will be the 4D tensor output of the last convolutional block. 
avg means that global average pooling will be applied to the output of the last convolutional block, and thus the output of the model will be a 2D tensor. 
max means that global max pooling will be applied. 

 
  classes   optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified.   
 


 Returns   A Keras model instance.
tf.keras.applications.DenseNet201     View source on GitHub    Instantiates the Densenet201 architecture.  View aliases  Main aliases 
tf.keras.applications.densenet.DenseNet201 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.DenseNet201, tf.compat.v1.keras.applications.densenet.DenseNet201  
tf.keras.applications.DenseNet201(
    include_top=True, weights='imagenet', input_tensor=None,
    input_shape=None, pooling=None, classes=1000
)
 Reference:  
Densely Connected Convolutional Networks (CVPR 2017)  Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is the one specified in your Keras config at ~/.keras/keras.json. 
Note: each Keras Application expects a specific kind of input preprocessing. For DenseNet, call tf.keras.applications.densenet.preprocess_input on your inputs before passing them to the model.

 


 Arguments
  include_top   whether to include the fully-connected layer at the top of the network.  
  weights   one of None (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded.  
  input_tensor   optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.  
  input_shape   optional shape tuple, only to be specified if include_top is False (otherwise the input shape has to be (224, 224, 3) (with 'channels_last' data format) or (3, 224, 224) (with 'channels_first' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 32. E.g. (200, 200, 3) would be one valid value.  
  pooling   Optional pooling mode for feature extraction when include_top is False.  
None means that the output of the model will be the 4D tensor output of the last convolutional block. 
avg means that global average pooling will be applied to the output of the last convolutional block, and thus the output of the model will be a 2D tensor. 
max means that global max pooling will be applied. 

 
  classes   optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified.   
 


 Returns   A Keras model instance.
Module: tf.keras.applications.efficientnet EfficientNet models for Keras. Reference:  
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks (ICML 2019)  Functions EfficientNetB0(...): Instantiates the EfficientNetB0 architecture. EfficientNetB1(...): Instantiates the EfficientNetB1 architecture. EfficientNetB2(...): Instantiates the EfficientNetB2 architecture. EfficientNetB3(...): Instantiates the EfficientNetB3 architecture. EfficientNetB4(...): Instantiates the EfficientNetB4 architecture. EfficientNetB5(...): Instantiates the EfficientNetB5 architecture. EfficientNetB6(...): Instantiates the EfficientNetB6 architecture. EfficientNetB7(...): Instantiates the EfficientNetB7 architecture. decode_predictions(...): Decodes the prediction of an ImageNet model. preprocess_input(...)
tf.keras.applications.efficientnet.decode_predictions Decodes the prediction of an ImageNet model.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.applications.efficientnet.decode_predictions  
tf.keras.applications.efficientnet.decode_predictions(
    preds, top=5
)

 


 Arguments
  preds   Numpy array encoding a batch of predictions.  
  top   Integer, how many top-guesses to return. Defaults to 5.   
 


 Returns   A list of lists of top class prediction tuples (class_name, class_description, score). One list of tuples per sample in batch input.  

 


 Raises
  ValueError   In case of invalid shape of the pred array (must be 2D).
tf.keras.applications.efficientnet.preprocess_input  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.keras.applications.efficientnet.preprocess_input  
tf.keras.applications.efficientnet.preprocess_input(
    x, data_format=None
)
tf.keras.applications.EfficientNetB0 Instantiates the EfficientNetB0 architecture.  View aliases  Main aliases 
tf.keras.applications.efficientnet.EfficientNetB0 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.EfficientNetB0, tf.compat.v1.keras.applications.efficientnet.EfficientNetB0  
tf.keras.applications.EfficientNetB0(
    include_top=True, weights='imagenet', input_tensor=None,
    input_shape=None, pooling=None, classes=1000,
    classifier_activation='softmax', **kwargs
)
 Reference:  
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks (ICML 2019)  Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is the one specified in your Keras config at ~/.keras/keras.json. If you have never configured it, it defaults to "channels_last".
 


 Arguments
  include_top   Whether to include the fully-connected layer at the top of the network. Defaults to True.  
  weights   One of None (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. Defaults to 'imagenet'.  
  input_tensor   Optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.  
  input_shape   Optional shape tuple, only to be specified if include_top is False. It should have exactly 3 inputs channels.  
  pooling   Optional pooling mode for feature extraction when include_top is False. Defaults to None.  
None means that the output of the model will be the 4D tensor output of the last convolutional layer. 
avg means that global average pooling will be applied to the output of the last convolutional layer, and thus the output of the model will be a 2D tensor. 
max means that global max pooling will be applied. 

 
  classes   Optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified. Defaults to 1000 (number of ImageNet classes).  
  classifier_activation   A str or callable. The activation function to use on the "top" layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the "top" layer. Defaults to 'softmax'.   
 


 Returns   A keras.Model instance.
tf.keras.applications.EfficientNetB1 Instantiates the EfficientNetB1 architecture.  View aliases  Main aliases 
tf.keras.applications.efficientnet.EfficientNetB1 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.EfficientNetB1, tf.compat.v1.keras.applications.efficientnet.EfficientNetB1  
tf.keras.applications.EfficientNetB1(
    include_top=True, weights='imagenet', input_tensor=None,
    input_shape=None, pooling=None, classes=1000,
    classifier_activation='softmax', **kwargs
)
 Reference:  
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks (ICML 2019)  Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is the one specified in your Keras config at ~/.keras/keras.json. If you have never configured it, it defaults to "channels_last".
 


 Arguments
  include_top   Whether to include the fully-connected layer at the top of the network. Defaults to True.  
  weights   One of None (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. Defaults to 'imagenet'.  
  input_tensor   Optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.  
  input_shape   Optional shape tuple, only to be specified if include_top is False. It should have exactly 3 inputs channels.  
  pooling   Optional pooling mode for feature extraction when include_top is False. Defaults to None.  
None means that the output of the model will be the 4D tensor output of the last convolutional layer. 
avg means that global average pooling will be applied to the output of the last convolutional layer, and thus the output of the model will be a 2D tensor. 
max means that global max pooling will be applied. 

 
  classes   Optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified. Defaults to 1000 (number of ImageNet classes).  
  classifier_activation   A str or callable. The activation function to use on the "top" layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the "top" layer. Defaults to 'softmax'.   
 


 Returns   A keras.Model instance.
tf.keras.applications.EfficientNetB2 Instantiates the EfficientNetB2 architecture.  View aliases  Main aliases 
tf.keras.applications.efficientnet.EfficientNetB2 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.EfficientNetB2, tf.compat.v1.keras.applications.efficientnet.EfficientNetB2  
tf.keras.applications.EfficientNetB2(
    include_top=True, weights='imagenet', input_tensor=None,
    input_shape=None, pooling=None, classes=1000,
    classifier_activation='softmax', **kwargs
)
 Reference:  
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks (ICML 2019)  Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is the one specified in your Keras config at ~/.keras/keras.json. If you have never configured it, it defaults to "channels_last".
 


 Arguments
  include_top   Whether to include the fully-connected layer at the top of the network. Defaults to True.  
  weights   One of None (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. Defaults to 'imagenet'.  
  input_tensor   Optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.  
  input_shape   Optional shape tuple, only to be specified if include_top is False. It should have exactly 3 inputs channels.  
  pooling   Optional pooling mode for feature extraction when include_top is False. Defaults to None.  
None means that the output of the model will be the 4D tensor output of the last convolutional layer. 
avg means that global average pooling will be applied to the output of the last convolutional layer, and thus the output of the model will be a 2D tensor. 
max means that global max pooling will be applied. 

 
  classes   Optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified. Defaults to 1000 (number of ImageNet classes).  
  classifier_activation   A str or callable. The activation function to use on the "top" layer. Ignored unless include_top=True. Set classifier_activation=None to return the logits of the "top" layer. Defaults to 'softmax'.   
 


 Returns   A keras.Model instance.