---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:149460
- loss:ContrastiveLoss
base_model: sentence-transformers/clip-ViT-B-32
widget:
- source_sentence: Meltdown
sentences:
- Ancient Imperiosaur
- https://cards.scryfall.io/normal/front/1/9/192ccc7f-ffb1-4f78-8cf0-a220df612be7.jpg?1682536817
- https://cards.scryfall.io/normal/front/5/6/56301392-3496-48d0-8d91-6b82e1164c98.jpg?1721427942
- source_sentence: Etali, Primal Storm
sentences:
- https://cards.scryfall.io/normal/front/4/8/4874388e-0227-4b89-a986-d86c14482c81.jpg?1594065427
- Battle of Wits
- https://cards.scryfall.io/normal/front/1/d/1d3d8bb4-0430-45bb-930d-5d6db6521945.jpg?1587309687
- source_sentence: Chrome Prowler
sentences:
- https://cards.scryfall.io/normal/front/a/2/a263f594-621e-46af-8561-f7eee565a19a.jpg?1562643297
- https://cards.scryfall.io/normal/front/3/d/3dff363d-7e9f-4764-a9ee-ec2f23239df6.jpg?1562907900
- https://cards.scryfall.io/normal/front/2/1/21121857-85b8-4ba8-9363-beafdb1005c2.jpg?1730486782
- source_sentence: Beastbreaker of Bala Ged
sentences:
- https://cards.scryfall.io/normal/front/2/8/287ca034-9cea-4b84-98ba-76c24f038edb.jpg?1599709496
- https://cards.scryfall.io/normal/front/5/4/547f2641-bcd6-4536-ba5a-f46170dd2803.jpg?1573513110
- https://cards.scryfall.io/normal/front/4/c/4c29f6a1-42a5-433f-9c09-c160b096f8e1.jpg?1562542378
- source_sentence: Against All Odds
sentences:
- https://cards.scryfall.io/normal/front/4/a/4ab2f81a-fcbe-44d1-8281-04dd78bb9ea3.jpg?1593274931
- https://cards.scryfall.io/normal/front/3/c/3cd8dd4e-6892-49d7-8fae-97d04f9f6c84.jpg?1675956885
- Sheltering Prayers
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on sentence-transformers/clip-ViT-B-32
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/clip-ViT-B-32](https://huggingface.co/sentence-transformers/clip-ViT-B-32). It maps sentences & paragraphs to a None-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [sentence-transformers/clip-ViT-B-32](https://huggingface.co/sentence-transformers/clip-ViT-B-32)
- **Maximum Sequence Length:** 77 tokens
- **Output Dimensionality:** None dimensions
- **Similarity Function:** Cosine Similarity
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): CLIPModel()
)
```
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("philipp-zettl/MTGEmb-small")
# Run inference
sentences = [
'Against All Odds',
'https://cards.scryfall.io/normal/front/3/c/3cd8dd4e-6892-49d7-8fae-97d04f9f6c84.jpg?1675956885',
'https://cards.scryfall.io/normal/front/4/a/4ab2f81a-fcbe-44d1-8281-04dd78bb9ea3.jpg?1593274931',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.9248, 0.6695],
# [0.9248, 1.0000, 0.6947],
# [0.6695, 0.6947, 1.0000]])
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 149,460 training samples
* Columns: sentence_0, sentence_1, and label
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:------------------------------------------------|
| type | string | string | int |
| details |
Comparative Analysis | https://cards.scryfall.io/normal/front/d/d/dd83129b-7e8c-4cc5-a7b3-e0ae221d7ad4.jpg?1562939549 | 1 |
| Breathkeeper Seraph | https://cards.scryfall.io/normal/front/1/b/1bdd3ecb-8c11-4a4c-a503-bc29f79a9dcb.jpg?1682204691 | 0 |
| Wei Infantry | https://cards.scryfall.io/normal/front/7/2/72c6465f-3144-4faf-b248-a9fb941dc002.jpg?1562257016 | 1 |
* Loss: [ContrastiveLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
```json
{
"distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
"margin": 0.5,
"size_average": true
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 64
- `per_device_eval_batch_size`: 64
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters