source
stringclasses 470
values | url
stringlengths 49
167
| file_type
stringclasses 1
value | chunk
stringlengths 1
512
| chunk_id
stringlengths 5
9
|
---|---|---|---|---|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mt5.md
|
https://huggingface.co/docs/transformers/en/model_doc/mt5/#mt5forquestionanswering
|
.md
|
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.
Parameters:
config ([`MT5Config`]): Model configuration class with all the parameters of the model.
|
245_12_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mt5.md
|
https://huggingface.co/docs/transformers/en/model_doc/mt5/#mt5forquestionanswering
|
.md
|
and behavior.
Parameters:
config ([`MT5Config`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
</pt>
<tf>
|
245_12_3
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mt5.md
|
https://huggingface.co/docs/transformers/en/model_doc/mt5/#tfmt5model
|
.md
|
No docstring available for TFMT5Model
|
245_13_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mt5.md
|
https://huggingface.co/docs/transformers/en/model_doc/mt5/#tfmt5forconditionalgeneration
|
.md
|
No docstring available for TFMT5ForConditionalGeneration
|
245_14_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mt5.md
|
https://huggingface.co/docs/transformers/en/model_doc/mt5/#tfmt5encodermodel
|
.md
|
No docstring available for TFMT5EncoderModel
</tf>
<jax>
|
245_15_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mt5.md
|
https://huggingface.co/docs/transformers/en/model_doc/mt5/#flaxmt5model
|
.md
|
No docstring available for FlaxMT5Model
|
245_16_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mt5.md
|
https://huggingface.co/docs/transformers/en/model_doc/mt5/#flaxmt5forconditionalgeneration
|
.md
|
No docstring available for FlaxMT5ForConditionalGeneration
|
245_17_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mt5.md
|
https://huggingface.co/docs/transformers/en/model_doc/mt5/#flaxmt5encodermodel
|
.md
|
No docstring available for FlaxMT5EncoderModel
</jax>
</frameworkcontent>
|
245_18_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/
|
.md
|
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
246_0_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/
|
.md
|
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
-->
|
246_0_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
Hiera was proposed in [Hiera: A Hierarchical Vision Transformer without the Bells-and-Whistles](https://arxiv.org/abs/2306.00989) by Chaitanya Ryali, Yuan-Ting Hu, Daniel Bolya, Chen Wei, Haoqi Fan, Po-Yao Huang, Vaibhav Aggarwal, Arkabandhu Chowdhury, Omid Poursaeed, Judy Hoffman, Jitendra Malik, Yanghao Li, Christoph Feichtenhofer
|
246_1_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
The paper introduces "Hiera," a hierarchical Vision Transformer that simplifies the architecture of modern hierarchical vision transformers by removing unnecessary components without compromising on accuracy or efficiency. Unlike traditional transformers that add complex vision-specific components to improve supervised classification performance, Hiera demonstrates that such additions, often termed "bells-and-whistles," are not essential for high accuracy. By leveraging a strong visual pretext task (MAE)
|
246_1_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
often termed "bells-and-whistles," are not essential for high accuracy. By leveraging a strong visual pretext task (MAE) for pretraining, Hiera retains simplicity and achieves superior accuracy and speed both in inference and training across various image and video recognition tasks. The approach suggests that spatial biases required for vision tasks can be effectively learned through proper pretraining, eliminating the need for added architectural complexity.
|
246_1_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
The abstract from the paper is the following:
|
246_1_3
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
*Modern hierarchical vision transformers have added several vision-specific components in the pursuit of supervised classification performance. While these components lead to effective accuracies and attractive FLOP counts, the added complexity actually makes these transformers slower than their vanilla ViT counterparts. In this paper, we argue that this additional bulk is unnecessary. By pretraining with a strong visual pretext task (MAE), we can strip out all the bells-and-whistles from a
|
246_1_4
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
bulk is unnecessary. By pretraining with a strong visual pretext task (MAE), we can strip out all the bells-and-whistles from a state-of-the-art multi-stage vision transformer without losing accuracy. In the process, we create Hiera, an extremely simple hierarchical vision transformer that is more accurate than previous models while being significantly faster both at inference and during training. We evaluate Hiera on a variety of tasks for image and video recognition. Our code and models are available at
|
246_1_5
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
during training. We evaluate Hiera on a variety of tasks for image and video recognition. Our code and models are available at https://github.com/facebookresearch/hiera.*
|
246_1_6
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/hiera_overview.png"
alt="drawing" width="600"/>
<small> Hiera architecture. Taken from the <a href="https://arxiv.org/abs/2306.00989">original paper.</a> </small>
|
246_1_7
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#overview
|
.md
|
<small> Hiera architecture. Taken from the <a href="https://arxiv.org/abs/2306.00989">original paper.</a> </small>
This model was a joint contribution by [EduardoPacheco](https://huggingface.co/EduardoPacheco) and [namangarg110](https://huggingface.co/namangarg110). The original code can be found [here] (https://github.com/facebookresearch/hiera).
|
246_1_8
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#resources
|
.md
|
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with Hiera. If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.
<PipelineTag pipeline="image-classification"/>
|
246_2_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#resources
|
.md
|
<PipelineTag pipeline="image-classification"/>
- [`HieraForImageClassification`] is supported by this [example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb).
- See also: [Image classification task guide](../tasks/image_classification)
|
246_2_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
This is the configuration class to store the configuration of a [`HieraModel`]. It is used to instantiate a Hiera
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Hiera
[facebook/hiera-base-224](https://huggingface.co/facebook/hiera-base-224) architecture.
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
246_3_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.
Args:
embed_dim (`int`, *optional*, defaults to 96):
Dimensionality of patch embedding.
image_size (`list(int)`, *optional*, defaults to `[224, 224]`):
The size (resolution) of input in the format (height, width) for images
and (frames, height, width) for videos.
patch_size (`list(int)`, *optional*, defaults to `[7, 7]`):
|
246_3_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
and (frames, height, width) for videos.
patch_size (`list(int)`, *optional*, defaults to `[7, 7]`):
The size (resolution) of each patch.
patch_stride (`list(int)`, *optional*, defaults to `[4, 4]`):
The stride of the patch.
patch_padding (`list(int)`, *optional*, defaults to `[3, 3]`):
The padding of the patch.
mlp_ratio (`float`, *optional*, defaults to 4.0):
The ratio of mlp hidden dim to embedding dim.
depths (`list(int)`, *optional*, defaults to `[2, 3, 16, 3]`):
|
246_3_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
The ratio of mlp hidden dim to embedding dim.
depths (`list(int)`, *optional*, defaults to `[2, 3, 16, 3]`):
Depth of each layer in the Transformer encoder.
num_heads (`list(int)`, *optional*, defaults to `[1, 2, 4, 8]`):
Number of attention heads in each layer of the Transformer encoder.
embed_dim_multiplier (`float`, *optional*, defaults to 2.0):
The multiplier to the dimensionality of patch embedding in each layer of the Transformer encoder.
num_query_pool (`int`, *optional*, defaults to 3):
|
246_3_3
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
num_query_pool (`int`, *optional*, defaults to 3):
The number of query pool stages.
query_stride (`list(int)`, *optional*, defaults to `[2, 2]`):
The stride of the query pool.
masked_unit_size (`list(int)`, *optional*, defaults to `[8, 8]`):
The size of the masked unit.
masked_unit_attention (`list(bool)`, *optional*, defaults to `[True, True, False, False]`):
Whether to use masked unit attention in each layer of the Transformer encoder.
drop_path_rate (`float`, *optional*, defaults to 0.0):
|
246_3_4
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
drop_path_rate (`float`, *optional*, defaults to 0.0):
The drop path rate.
num_channels (`int`, *optional*, defaults to 3):
The number of input channels.
hidden_act (`str`, *optional*, defaults to `"gelu"`):
The non-linear activation function (function or string) in the encoder. If string, `"gelu"`, `"relu"`,
`"selu"` and `"gelu_new"` are supported.
initializer_range (`float`, *optional*, defaults to 0.02):
The standard deviation of the truncated_normal_initializer for initializing all weight matrices and
|
246_3_5
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
The standard deviation of the truncated_normal_initializer for initializing all weight matrices and
the zero_initializer for initializing all bias vectors.
layer_norm_init (`float`, *optional*, defaults to 1.0):
The initial weight value for layer normalization layers.
layer_norm_eps (`float`, *optional*, defaults to 1e-06):
The epsilon used by the layer normalization layers.
decoder_hidden_size (`int`, *optional*):
Dimensionality of decoder embeddings for MAE pretraining.
decoder_depth (`int`, *optional*):
|
246_3_6
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
Dimensionality of decoder embeddings for MAE pretraining.
decoder_depth (`int`, *optional*):
Depth of the decoder for MAE pretraining.
decoder_num_heads (`int`, *optional*):
Number of attention heads in each layer of the decoder for MAE pretraining.
normalize_pixel_loss (`bool`, *optional*, defaults to `True`):
Whether to normalize the pixel loss by the number of pixels.
mask_ratio (`float`, *optional*, defaults to 0.6):
The ratio of masked tokens in the input.
out_features (`List[str]`, *optional*):
|
246_3_7
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
The ratio of masked tokens in the input.
out_features (`List[str]`, *optional*):
If used as backbone, list of features to output. Can be any of `"stem"`, `"stage1"`, `"stage2"`, etc.
(depending on how many stages the model has). If unset and `out_indices` is set, will default to the
corresponding stages. If unset and `out_indices` is unset, will default to the last stage. Must be in the
same order as defined in the `stage_names` attribute.
out_indices (`List[int]`, *optional*):
|
246_3_8
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
same order as defined in the `stage_names` attribute.
out_indices (`List[int]`, *optional*):
If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
many stages the model has). If unset and `out_features` is set, will default to the corresponding stages.
If unset and `out_features` is unset, will default to the last stage. Must be in the
same order as defined in the `stage_names` attribute.
Example:
```python
|
246_3_9
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
same order as defined in the `stage_names` attribute.
Example:
```python
>>> from transformers import HieraConfig, HieraModel
|
246_3_10
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraconfig
|
.md
|
>>> # Initializing a Hiera hiera-base-patch16-224 style configuration
>>> configuration = HieraConfig()
>>> # Initializing a model (with random weights) from the hiera-base-patch16-224 style configuration
>>> model = HieraModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
```
|
246_3_11
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieramodel
|
.md
|
The bare Hiera Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
config ([`HieraConfig`]): Model configuration class with all the parameters of the model.
|
246_4_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieramodel
|
.md
|
behavior.
Parameters:
config ([`HieraConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
add_pooling_layer (`bool`, *optional*, defaults to `True`):
Whether or not to apply pooling layer.
is_mae (`bool`, *optional*, defaults to `False`):
Whether or not to run the model on MAE mode.
|
246_4_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieramodel
|
.md
|
is_mae (`bool`, *optional*, defaults to `False`):
Whether or not to run the model on MAE mode.
Methods: forward
|
246_4_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraforpretraining
|
.md
|
The Hiera Model transformer with the decoder on top for self-supervised pre-training.
<Tip>
Note that we provide a script to pre-train this model on custom data in our [examples
directory](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining).
</Tip>
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it
|
246_5_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraforpretraining
|
.md
|
</Tip>
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
config ([`HieraConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
|
246_5_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraforpretraining
|
.md
|
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
|
246_5_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraforimageclassification
|
.md
|
Hiera Model transformer with an image classification head on top (a linear layer on top of the final hidden state with
average pooling) e.g. for ImageNet.
<Tip>
Note that it's possible to fine-tune Hiera on higher resolution images than the ones it has been trained on, by
setting `interpolate_pos_encoding` to `True` in the forward of the model. This will interpolate the pre-trained
position embeddings to the higher resolution.
</Tip>
|
246_6_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraforimageclassification
|
.md
|
position embeddings to the higher resolution.
</Tip>
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
config ([`HieraConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
|
246_6_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/hiera.md
|
https://huggingface.co/docs/transformers/en/model_doc/hiera/#hieraforimageclassification
|
.md
|
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
|
246_6_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/
|
.md
|
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
247_0_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/
|
.md
|
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
-->
|
247_0_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbert
|
.md
|
<div class="flex flex-wrap space-x-1">
<a href="https://huggingface.co/models?filter=convbert">
<img alt="Models" src="https://img.shields.io/badge/All_model_pages-convbert-blueviolet">
</a>
<a href="https://huggingface.co/spaces/docs-demos/conv-bert-base">
<img alt="Spaces" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue">
</a>
</div>
|
247_1_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#overview
|
.md
|
The ConvBERT model was proposed in [ConvBERT: Improving BERT with Span-based Dynamic Convolution](https://arxiv.org/abs/2008.02496) by Zihang Jiang, Weihao Yu, Daquan Zhou, Yunpeng Chen, Jiashi Feng, Shuicheng
Yan.
The abstract from the paper is the following:
*Pre-trained language models like BERT and its variants have recently achieved impressive performance in various
natural language understanding tasks. However, BERT heavily relies on the global self-attention block and thus suffers
|
247_2_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#overview
|
.md
|
natural language understanding tasks. However, BERT heavily relies on the global self-attention block and thus suffers
large memory footprint and computation cost. Although all its attention heads query on the whole input sequence for
generating the attention map from a global perspective, we observe some heads only need to learn local dependencies,
which means the existence of computation redundancy. We therefore propose a novel span-based dynamic convolution to
|
247_2_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#overview
|
.md
|
which means the existence of computation redundancy. We therefore propose a novel span-based dynamic convolution to
replace these self-attention heads to directly model local dependencies. The novel convolution heads, together with the
rest self-attention heads, form a new mixed attention block that is more efficient at both global and local context
learning. We equip BERT with this mixed attention design and build a ConvBERT model. Experiments have shown that
|
247_2_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#overview
|
.md
|
learning. We equip BERT with this mixed attention design and build a ConvBERT model. Experiments have shown that
ConvBERT significantly outperforms BERT and its variants in various downstream tasks, with lower training cost and
fewer model parameters. Remarkably, ConvBERTbase model achieves 86.4 GLUE score, 0.7 higher than ELECTRAbase, while
using less than 1/4 training cost. Code and pre-trained models will be released.*
|
247_2_3
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#overview
|
.md
|
using less than 1/4 training cost. Code and pre-trained models will be released.*
This model was contributed by [abhishek](https://huggingface.co/abhishek). The original implementation can be found
here: https://github.com/yitu-opensource/ConvBert
|
247_2_4
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#usage-tips
|
.md
|
ConvBERT training tips are similar to those of BERT. For usage tips refer to [BERT documentation](bert).
|
247_3_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#resources
|
.md
|
- [Text classification task guide](../tasks/sequence_classification)
- [Token classification task guide](../tasks/token_classification)
- [Question answering task guide](../tasks/question_answering)
- [Masked language modeling task guide](../tasks/masked_language_modeling)
- [Multiple choice task guide](../tasks/multiple_choice)
|
247_4_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
This is the configuration class to store the configuration of a [`ConvBertModel`]. It is used to instantiate an
ConvBERT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ConvBERT
[YituTech/conv-bert-base](https://huggingface.co/YituTech/conv-bert-base) architecture.
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
247_5_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
Vocabulary size of the ConvBERT model. Defines the number of different tokens that can be represented by
the `inputs_ids` passed when calling [`ConvBertModel`] or [`TFConvBertModel`].
hidden_size (`int`, *optional*, defaults to 768):
|
247_5_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
hidden_size (`int`, *optional*, defaults to 768):
Dimensionality of the encoder layers and the pooler layer.
num_hidden_layers (`int`, *optional*, defaults to 12):
Number of hidden layers in the Transformer encoder.
num_attention_heads (`int`, *optional*, defaults to 12):
Number of attention heads for each attention layer in the Transformer encoder.
intermediate_size (`int`, *optional*, defaults to 3072):
Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
|
247_5_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
hidden_act (`str` or `function`, *optional*, defaults to `"gelu"`):
The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
`"relu"`, `"selu"` and `"gelu_new"` are supported.
hidden_dropout_prob (`float`, *optional*, defaults to 0.1):
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
|
247_5_3
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
attention_probs_dropout_prob (`float`, *optional*, defaults to 0.1):
The dropout ratio for the attention probabilities.
max_position_embeddings (`int`, *optional*, defaults to 512):
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).
type_vocab_size (`int`, *optional*, defaults to 2):
|
247_5_4
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
just in case (e.g., 512 or 1024 or 2048).
type_vocab_size (`int`, *optional*, defaults to 2):
The vocabulary size of the `token_type_ids` passed when calling [`ConvBertModel`] or [`TFConvBertModel`].
initializer_range (`float`, *optional*, defaults to 0.02):
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
layer_norm_eps (`float`, *optional*, defaults to 1e-12):
The epsilon used by the layer normalization layers.
head_ratio (`int`, *optional*, defaults to 2):
|
247_5_5
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
The epsilon used by the layer normalization layers.
head_ratio (`int`, *optional*, defaults to 2):
Ratio gamma to reduce the number of attention heads.
num_groups (`int`, *optional*, defaults to 1):
The number of groups for grouped linear layers for ConvBert model
conv_kernel_size (`int`, *optional*, defaults to 9):
The size of the convolutional kernel.
classifier_dropout (`float`, *optional*):
The dropout ratio for the classification head.
Example:
```python
|
247_5_6
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
classifier_dropout (`float`, *optional*):
The dropout ratio for the classification head.
Example:
```python
>>> from transformers import ConvBertConfig, ConvBertModel
|
247_5_7
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertconfig
|
.md
|
>>> # Initializing a ConvBERT convbert-base-uncased style configuration
>>> configuration = ConvBertConfig()
>>> # Initializing a model (with random weights) from the convbert-base-uncased style configuration
>>> model = ConvBertModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
```
|
247_5_8
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizer
|
.md
|
Construct a ConvBERT tokenizer. Based on WordPiece.
This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.
Args:
vocab_file (`str`):
File containing the vocabulary.
do_lower_case (`bool`, *optional*, defaults to `True`):
Whether or not to lowercase the input when tokenizing.
do_basic_tokenize (`bool`, *optional*, defaults to `True`):
|
247_6_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizer
|
.md
|
Whether or not to lowercase the input when tokenizing.
do_basic_tokenize (`bool`, *optional*, defaults to `True`):
Whether or not to do basic tokenization before WordPiece.
never_split (`Iterable`, *optional*):
Collection of tokens which will never be split during tokenization. Only has an effect when
`do_basic_tokenize=True`
unk_token (`str`, *optional*, defaults to `"[UNK]"`):
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.
|
247_6_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizer
|
.md
|
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.
sep_token (`str`, *optional*, defaults to `"[SEP]"`):
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.
pad_token (`str`, *optional*, defaults to `"[PAD]"`):
|
247_6_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizer
|
.md
|
token of a sequence built with special tokens.
pad_token (`str`, *optional*, defaults to `"[PAD]"`):
The token used for padding, for example when batching sequences of different lengths.
cls_token (`str`, *optional*, defaults to `"[CLS]"`):
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.
|
247_6_3
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizer
|
.md
|
instead of per-token classification). It is the first token of the sequence when built with special tokens.
mask_token (`str`, *optional*, defaults to `"[MASK]"`):
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.
tokenize_chinese_chars (`bool`, *optional*, defaults to `True`):
Whether or not to tokenize Chinese characters.
This should likely be deactivated for Japanese (see this
|
247_6_4
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizer
|
.md
|
Whether or not to tokenize Chinese characters.
This should likely be deactivated for Japanese (see this
[issue](https://github.com/huggingface/transformers/issues/328)).
strip_accents (`bool`, *optional*):
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for `lowercase` (as in the original ConvBERT).
clean_up_tokenization_spaces (`bool`, *optional*, defaults to `True`):
|
247_6_5
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizer
|
.md
|
value for `lowercase` (as in the original ConvBERT).
clean_up_tokenization_spaces (`bool`, *optional*, defaults to `True`):
Whether or not to cleanup spaces after decoding, cleanup consists in removing potential artifacts like
extra spaces.
Methods: build_inputs_with_special_tokens
- get_special_tokens_mask
- create_token_type_ids_from_sequences
- save_vocabulary
|
247_6_6
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizerfast
|
.md
|
Construct a "fast" ConvBERT tokenizer (backed by HuggingFace's *tokenizers* library). Based on WordPiece.
This tokenizer inherits from [`PreTrainedTokenizerFast`] which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.
Args:
vocab_file (`str`):
File containing the vocabulary.
do_lower_case (`bool`, *optional*, defaults to `True`):
Whether or not to lowercase the input when tokenizing.
|
247_7_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizerfast
|
.md
|
do_lower_case (`bool`, *optional*, defaults to `True`):
Whether or not to lowercase the input when tokenizing.
unk_token (`str`, *optional*, defaults to `"[UNK]"`):
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.
sep_token (`str`, *optional*, defaults to `"[SEP]"`):
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
|
247_7_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizerfast
|
.md
|
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.
pad_token (`str`, *optional*, defaults to `"[PAD]"`):
The token used for padding, for example when batching sequences of different lengths.
cls_token (`str`, *optional*, defaults to `"[CLS]"`):
|
247_7_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizerfast
|
.md
|
cls_token (`str`, *optional*, defaults to `"[CLS]"`):
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.
mask_token (`str`, *optional*, defaults to `"[MASK]"`):
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.
|
247_7_3
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizerfast
|
.md
|
modeling. This is the token which the model will try to predict.
clean_text (`bool`, *optional*, defaults to `True`):
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.
tokenize_chinese_chars (`bool`, *optional*, defaults to `True`):
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see [this
issue](https://github.com/huggingface/transformers/issues/328)).
|
247_7_4
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convberttokenizerfast
|
.md
|
issue](https://github.com/huggingface/transformers/issues/328)).
strip_accents (`bool`, *optional*):
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for `lowercase` (as in the original ConvBERT).
wordpieces_prefix (`str`, *optional*, defaults to `"##"`):
The prefix for subwords.
<frameworkcontent>
<pt>
|
247_7_5
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertmodel
|
.md
|
The bare ConvBERT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
|
247_8_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertmodel
|
.md
|
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
|
247_8_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertformaskedlm
|
.md
|
ConvBERT Model with a `language modeling` head on top.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
|
247_9_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertformaskedlm
|
.md
|
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
|
247_9_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertforsequenceclassification
|
.md
|
ConvBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
|
247_10_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertforsequenceclassification
|
.md
|
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
|
247_10_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertformultiplechoice
|
.md
|
ConvBERT Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
|
247_11_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertformultiplechoice
|
.md
|
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
|
247_11_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertfortokenclassification
|
.md
|
ConvBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
|
247_12_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertfortokenclassification
|
.md
|
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
|
247_12_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertforquestionanswering
|
.md
|
ConvBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `span start logits` and `span end logits`).
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.
Parameters:
|
247_13_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#convbertforquestionanswering
|
.md
|
behavior.
Parameters:
config ([`ConvBertConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
</pt>
<tf>
|
247_13_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#tfconvbertmodel
|
.md
|
No docstring available for TFConvBertModel
Methods: call
|
247_14_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#tfconvbertformaskedlm
|
.md
|
No docstring available for TFConvBertForMaskedLM
Methods: call
|
247_15_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#tfconvbertforsequenceclassification
|
.md
|
No docstring available for TFConvBertForSequenceClassification
Methods: call
|
247_16_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#tfconvbertformultiplechoice
|
.md
|
No docstring available for TFConvBertForMultipleChoice
Methods: call
|
247_17_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#tfconvbertfortokenclassification
|
.md
|
No docstring available for TFConvBertForTokenClassification
Methods: call
|
247_18_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/convbert.md
|
https://huggingface.co/docs/transformers/en/model_doc/convbert/#tfconvbertforquestionanswering
|
.md
|
No docstring available for TFConvBertForQuestionAnswering
Methods: call
</tf>
</frameworkcontent>
|
247_19_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/sam.md
|
https://huggingface.co/docs/transformers/en/model_doc/sam/
|
.md
|
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
248_0_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/sam.md
|
https://huggingface.co/docs/transformers/en/model_doc/sam/
|
.md
|
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
-->
|
248_0_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/sam.md
|
https://huggingface.co/docs/transformers/en/model_doc/sam/#overview
|
.md
|
SAM (Segment Anything Model) was proposed in [Segment Anything](https://arxiv.org/pdf/2304.02643v1.pdf) by Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alex Berg, Wan-Yen Lo, Piotr Dollar, Ross Girshick.
The model can be used to predict segmentation masks of any object of interest given an input image.
|
248_1_0
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/sam.md
|
https://huggingface.co/docs/transformers/en/model_doc/sam/#overview
|
.md
|
The model can be used to predict segmentation masks of any object of interest given an input image.

The abstract from the paper is the following:
|
248_1_1
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/sam.md
|
https://huggingface.co/docs/transformers/en/model_doc/sam/#overview
|
.md
|
*We introduce the Segment Anything (SA) project: a new task, model, and dataset for image segmentation. Using our efficient model in a data collection loop, we built the largest segmentation dataset to date (by far), with over 1 billion masks on 11M licensed and privacy respecting images. The model is designed and trained to be promptable, so it can transfer zero-shot to new image distributions and tasks. We evaluate its capabilities on numerous tasks and find that its zero-shot performance is impressive
|
248_1_2
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/sam.md
|
https://huggingface.co/docs/transformers/en/model_doc/sam/#overview
|
.md
|
distributions and tasks. We evaluate its capabilities on numerous tasks and find that its zero-shot performance is impressive -- often competitive with or even superior to prior fully supervised results. We are releasing the Segment Anything Model (SAM) and corresponding dataset (SA-1B) of 1B masks and 11M images at [https://segment-anything.com](https://segment-anything.com) to foster research into foundation models for computer vision.*
|
248_1_3
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/sam.md
|
https://huggingface.co/docs/transformers/en/model_doc/sam/#overview
|
.md
|
Tips:
- The model predicts binary masks that states the presence or not of the object of interest given an image.
- The model predicts much better results if input 2D points and/or input bounding boxes are provided
- You can prompt multiple points for the same image, and predict a single mask.
- Fine-tuning the model is not supported yet
|
248_1_4
|
/Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/sam.md
|
https://huggingface.co/docs/transformers/en/model_doc/sam/#overview
|
.md
|
- You can prompt multiple points for the same image, and predict a single mask.
- Fine-tuning the model is not supported yet
- According to the paper, textual input should be also supported. However, at this time of writing this seems not to be supported according to [the official repository](https://github.com/facebookresearch/segment-anything/issues/4#issuecomment-1497626844).
This model was contributed by [ybelkada](https://huggingface.co/ybelkada) and [ArthurZ](https://huggingface.co/ArthurZ).
|
248_1_5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.