neulab/docprompting-conala huggingface dataset:
tf.keras.applications.EfficientNetB3 Instantiates the EfficientNetB3 architecture.  View aliases  Main aliases 
tf.keras.applications.efficientnet.EfficientNetB3 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.EfficientNetB3, tf.compat.v1.keras.applications.efficientnet.EfficientNetB3  
tf.keras.applications.EfficientNetB3(
    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.EfficientNetB4 Instantiates the EfficientNetB4 architecture.  View aliases  Main aliases 
tf.keras.applications.efficientnet.EfficientNetB4 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.EfficientNetB4, tf.compat.v1.keras.applications.efficientnet.EfficientNetB4  
tf.keras.applications.EfficientNetB4(
    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.EfficientNetB5 Instantiates the EfficientNetB5 architecture.  View aliases  Main aliases 
tf.keras.applications.efficientnet.EfficientNetB5 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.EfficientNetB5, tf.compat.v1.keras.applications.efficientnet.EfficientNetB5  
tf.keras.applications.EfficientNetB5(
    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.EfficientNetB6 Instantiates the EfficientNetB6 architecture.  View aliases  Main aliases 
tf.keras.applications.efficientnet.EfficientNetB6 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.EfficientNetB6, tf.compat.v1.keras.applications.efficientnet.EfficientNetB6  
tf.keras.applications.EfficientNetB6(
    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.EfficientNetB7 Instantiates the EfficientNetB7 architecture.  View aliases  Main aliases 
tf.keras.applications.efficientnet.EfficientNetB7 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.EfficientNetB7, tf.compat.v1.keras.applications.efficientnet.EfficientNetB7  
tf.keras.applications.EfficientNetB7(
    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.
Module: tf.keras.applications.imagenet_utils Utilities for ImageNet data preprocessing & prediction decoding. Functions 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.imagenet_utils.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.imagenet_utils.decode_predictions  
tf.keras.applications.imagenet_utils.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.imagenet_utils.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.imagenet_utils.preprocess_input  
tf.keras.applications.imagenet_utils.preprocess_input(
    x, data_format=None, mode='caffe'
)
 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").  
  mode   One of "caffe", "tf" or "torch". Defaults to "caffe".  caffe: will convert the images from RGB to BGR, then will zero-center each color channel with respect to the ImageNet dataset, without scaling. tf: will scale pixels between -1 and 1, sample-wise. torch: will scale pixels between 0 and 1 and then will normalize each channel with respect to the ImageNet dataset. 

  
 


 Returns   Preprocessed numpy.array or a tf.Tensor with type float32.  

 


 Raises
  ValueError   In case of unknown mode or data_format argument.
tf.keras.applications.InceptionResNetV2     View source on GitHub    Instantiates the Inception-ResNet v2 architecture.  View aliases  Main aliases 
tf.keras.applications.inception_resnet_v2.InceptionResNetV2 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.InceptionResNetV2, tf.compat.v1.keras.applications.inception_resnet_v2.InceptionResNetV2  
tf.keras.applications.InceptionResNetV2(
    include_top=True, weights='imagenet', input_tensor=None,
    input_shape=None, pooling=None, classes=1000,
    classifier_activation='softmax', **kwargs
)
 Reference:  
Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning (AAAI 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 InceptionResNetV2, call tf.keras.applications.inception_resnet_v2.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 (299, 299, 3) (with 'channels_last' data format) or (3, 299, 299) (with 'channels_first' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 75. E.g. (150, 150, 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.  
  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.  
  **kwargs   For backwards compatibility only.   
 


 Returns   A keras.Model instance.  

 


 Raises
  ValueError   in case of invalid argument for weights, or invalid input shape.  
  ValueError   if classifier_activation is not softmax or None when using a pretrained top layer.
tf.keras.applications.InceptionV3     View source on GitHub    Instantiates the Inception v3 architecture.  View aliases  Main aliases 
tf.keras.applications.inception_v3.InceptionV3 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.InceptionV3, tf.compat.v1.keras.applications.inception_v3.InceptionV3  
tf.keras.applications.InceptionV3(
    include_top=True, weights='imagenet', input_tensor=None,
    input_shape=None, pooling=None, classes=1000,
    classifier_activation='softmax'
)
 Reference:  
Rethinking the Inception Architecture for Computer Vision (CVPR 2016)  Optionally loads weights pre-trained on ImageNet. Note that the data format convention used by the model is the one specified in the tf.keras.backend.image_data_format(). 
Note: each Keras Application expects a specific kind of input preprocessing. For InceptionV3, call tf.keras.applications.inception_v3.preprocess_input on your inputs before passing them to the model.

 


 Arguments
  include_top   Boolean, whether to include the fully-connected layer at the top, as the last layer of the network. Default to True.  
  weights   One of None (random initialization), imagenet (pre-training on ImageNet), or the path to the weights file to be loaded. Default to imagenet.  
  input_tensor   Optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model. input_tensor is useful for sharing inputs between multiple different networks. Default to None.  
  input_shape   Optional shape tuple, only to be specified if include_top is False (otherwise the input shape has to be (299, 299, 3) (with channels_last data format) or (3, 299, 299) (with channels_first data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 75. E.g. (150, 150, 3) would be one valid value. input_shape will be ignored if the input_tensor is provided.  
  pooling   Optional pooling mode for feature extraction when include_top is False.  
None (default) 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. Default to 1000.  
  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.   
 


 Returns   A keras.Model instance.  

 


 Raises
  ValueError   in case of invalid argument for weights, or invalid input shape.  
  ValueError   if classifier_activation is not softmax or None when using a pretrained top layer.
Module: tf.keras.applications.inception_resnet_v2 Inception-ResNet V2 model for Keras. Reference:  
Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning (AAAI 2017)  Functions InceptionResNetV2(...): Instantiates the Inception-ResNet v2 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.inception_resnet_v2.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.inception_resnet_v2.decode_predictions  
tf.keras.applications.inception_resnet_v2.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.inception_resnet_v2.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.inception_resnet_v2.preprocess_input  
tf.keras.applications.inception_resnet_v2.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 inputs pixel values are scaled between -1 and 1, sample-wise. 
 

 


 Raises
  ValueError   In case of unknown data_format argument.
Module: tf.keras.applications.inception_v3 Inception V3 model for Keras. Reference:  
Rethinking the Inception Architecture for Computer Vision (CVPR 2016)  Functions InceptionV3(...): Instantiates the Inception v3 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.inception_v3.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.inception_v3.decode_predictions  
tf.keras.applications.inception_v3.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).