unitorch.models.beit¤
BeitProcessor¤
Bases: HfImageClassificationProcessor
Initializes the BeitProcessor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vision_config_path |
str
|
The path to the vision configuration file. |
required |
Source code in src/unitorch/models/beit/processing.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
BeitForImageClassification¤
Bases: GenericModel
Initializes the BeitForImageClassification model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_path |
str
|
The path to the configuration file. |
required |
num_classes |
Optional[int]
|
The number of classes for classification. Defaults to 1. |
1
|
Source code in src/unitorch/models/beit/modeling.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
forward ¤
forward(pixel_values: Tensor)
Forward pass of the BeitForImageClassification model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pixel_values |
Tensor
|
The input tensor of pixel values. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
The logits of the model output. |
Source code in src/unitorch/models/beit/modeling.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|