exneg_simclr
ExNegSimCLR
Bases: SimCLR
Extended Negative Sampling SimCLR model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
backbone
|
Module
|
The backbone model. |
required |
num_ftrs
|
int
|
Number of features in the bottleneck layer. Default is 32. |
32
|
out_dim
|
int
|
Dimension of the output feature embeddings. Default is 128. |
128
|
Source code in fmcib/ssl/modules/exneg_simclr.py
__init__(backbone, num_ftrs=32, out_dim=128)
Initialize the object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
backbone
|
Module
|
The backbone neural network. |
required |
num_ftrs
|
int
|
The number of input features for the projection head. Default is 32. |
32
|
out_dim
|
int
|
The output dimension of the projection head. Default is 128. |
128
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in fmcib/ssl/modules/exneg_simclr.py
forward(x, return_features=False)
Forward pass of the ExNegSimCLR model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
Union[Dict, Tensor]
|
Input data. If a dictionary, it should contain multiple views of the same image. |
required |
return_features
|
bool
|
Whether to return the intermediate feature embeddings. Default is False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
Dict |
Output dictionary containing the forward pass results for each input view. |