Skip to content

Commit 946a97d

Browse files
committed
Add missing docstrings arguments for Cached... losses
1 parent 649a31c commit 946a97d

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

sentence_transformers/losses/CachedGISTEmbedLoss.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ def __init__(
8282
8383
Args:
8484
model: SentenceTransformer model
85-
guide: SentenceTransformer model to guide the in-batch
86-
negative sample selection.
87-
temperature: Temperature parameter to scale the cosine
88-
similarities.
85+
guide: SentenceTransformer model to guide the in-batch negative sample selection.
86+
temperature: Temperature parameter to scale the cosine similarities.
87+
mini_batch_size: Mini-batch size for the forward pass, this denotes how much memory is actually used during
88+
training and evaluation. The larger the mini-batch size, the more memory efficient the training is, but
89+
the slower the training will be. It's recommended to set it as high as your GPU memory allows. The default
90+
value is 32.
91+
show_progress_bar: If True, a progress bar for the mini-batches is shown during training. The default is False.
8992
9093
References:
9194
- Efficient Natural Language Response Suggestion for Smart Reply, Section 4.4: https://arxiv.org/pdf/1705.00652.pdf

sentence_transformers/losses/CachedMultipleNegativesRankingLoss.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,15 @@ def __init__(
8787
8888
Args:
8989
model: SentenceTransformer model
90-
scale: Output of similarity function is multiplied by scale
91-
value
92-
similarity_fct: similarity function between sentence
93-
embeddings. By default, cos_sim. Can also be set to dot
90+
scale: Output of similarity function is multiplied by scale value
91+
similarity_fct: similarity function between sentence embeddings. By default, cos_sim. Can also be set to dot
9492
product (and then set scale to 1)
95-
93+
mini_batch_size: Mini-batch size for the forward pass, this denotes how much memory is actually used during
94+
training and evaluation. The larger the mini-batch size, the more memory efficient the training is, but
95+
the slower the training will be. It's recommended to set it as high as your GPU memory allows. The default
96+
value is 32.
97+
show_progress_bar: If True, a progress bar for the mini-batches is shown during training. The default is False.
98+
9699
References:
97100
- Efficient Natural Language Response Suggestion for Smart Reply, Section 4.4: https://arxiv.org/pdf/1705.00652.pdf
98101
- Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup: https://arxiv.org/pdf/2101.06983.pdf

0 commit comments

Comments
 (0)