CoolFace
Modelpublic

dbourget/pb-small-10e-tsdae6e-philsim-cosine-6e-beatai-cosine-80e

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes81downloads
Model Card

SentenceTransformer based on dbourget/pb-small-10e-tsdae6e-philsim-cosine-6e-beatai-cosine-50e

This is a sentence-transformers model finetuned from dbourget/pb-small-10e-tsdae6e-philsim-cosine-6e-beatai-cosine-50e. It maps sentences & paragraphs to a 1024-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: dbourget/pb-small-10e-tsdae6e-philsim-cosine-6e-beatai-cosine-50e <!-- at revision 86e3b91181f7c10aa5a92184184dc50f0f25aa57 -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 1024 tokens
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

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("dbourget/pb-small-10e-tsdae6e-philsim-cosine-6e-beatai-cosine-80e")
# Run inference
sentences = [
    'scientific revolutions',
    'paradigm shifts',
    'scientific realism',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Triplet
MetricValue
cosine_accuracy0.814
dot_accuracy0.2273
manhattan_accuracy0.8199
euclidean_accuracy0.8157
max_accuracy0.8199

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: steps
  • —per_device_train_batch_size: 138
  • —per_device_eval_batch_size: 138
  • —learning_rate: 5e-07
  • —weight_decay: 0.01
  • —num_train_epochs: 30
  • —lr_scheduler_type: constant
  • —bf16: True
  • —dataloader_drop_last: True
  • —resume_from_checkpoint: True
All Hyperparameters

<details><summary>Click to expand</summary>

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: steps
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 138
  • —per_device_eval_batch_size: 138
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 1
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 5e-07
  • —weight_decay: 0.01
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 30
  • —max_steps: -1
  • —lr_scheduler_type: constant
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0
  • —warmup_steps: 0
  • —log_level: passive
  • —log_level_replica: warning
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —save_safetensors: True
  • —save_on_each_node: False
  • —save_only_model: False
  • —restore_callback_states_from_checkpoint: False
  • —no_cuda: False
  • —use_cpu: False
  • —use_mps_device: False
  • —seed: 42
  • —data_seed: None
  • —jit_mode_eval: False
  • —use_ipex: False
  • —bf16: True
  • —fp16: False
  • —fp16_opt_level: O1
  • —half_precision_backend: auto
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —local_rank: 0
  • —ddp_backend: None
  • —tpu_num_cores: None
  • —tpu_metrics_debug: False
  • —debug: []
  • —dataloader_drop_last: True
  • —dataloader_num_workers: 0
  • —dataloader_prefetch_factor: 2
  • —past_index: -1
  • —disable_tqdm: False
  • —remove_unused_columns: True
  • —label_names: None
  • —load_best_model_at_end: False
  • —ignore_data_skip: False
  • —fsdp: []
  • —fsdp_min_num_params: 0
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —fsdp_transformer_layer_cls_to_wrap: None
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamw_torch
  • —optim_args: None
  • —adafactor: False
  • —group_by_length: False
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —skip_memory_metrics: True
  • —use_legacy_prediction_loop: False
  • —push_to_hub: False
  • —resume_from_checkpoint: True
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_private_repo: False
  • —hub_always_push: False
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —eval_do_concat_batches: True
  • —fp16_backend: auto
  • —push_to_hub_model_id: None
  • —push_to_hub_organization: None
  • —mp_parameters:
  • —auto_find_batch_size: False
  • —full_determinism: False
  • —torchdynamo: None
  • —ray_scope: last
  • —ddp_timeout: 1800
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —dispatch_batches: None
  • —split_batches: None
  • —include_tokens_per_second: False
  • —include_num_input_tokens_seen: False
  • —neftune_noise_alpha: None
  • —optim_target_modules: None
  • —batch_eval_metrics: False
  • —eval_on_start: False
  • —use_liger_kernel: False
  • —eval_use_gather_object: False
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining Losslossbeatai-dev_cosine_accuracy
00--0.7904
0.1471100.0721--
0.2941200.0708--
0.4412300.0736--
0.5882400.0704--
0.7353500.07320.09710.7929
0.8824600.0716--
1.0294700.0665--
1.1765800.0698--
1.3235900.0699--
1.47061000.06910.09680.7912
1.61761100.0687--
1.76471200.0701--
1.91181300.0689--
2.05881400.0696--
2.20591500.0710.09660.7929
2.35291600.078--
2.51700.0675--
2.64711800.065--
2.79411900.0684--
2.94122000.06890.09630.7938
3.08822100.0736--
3.23532200.0684--
3.38242300.0669--
3.52942400.0688--
3.67652500.06780.09590.7963
3.82352600.0682--
3.97062700.0678--
4.11762800.0686--
4.26472900.0664--
4.41183000.07030.09570.7980
4.55883100.065--
4.70593200.0719--
4.85293300.0685--
5.03400.0639--
5.14713500.06670.09570.7971
5.29413600.0661--
5.44123700.0678--
5.58823800.0725--
5.73533900.0655--
5.88244000.06490.09530.7980
6.02944100.0661--
6.17654200.0662--
6.32354300.0671--
6.47064400.0698--
6.61764500.06360.09510.7980
6.76474600.0644--
6.91184700.0633--
7.05884800.0679--
7.20594900.067--
7.35295000.07130.09480.7963
7.55100.0677--
7.64715200.0666--
7.79415300.065--
7.94125400.0665--
8.08825500.06560.09460.7963
8.23535600.0649--
8.38245700.0649--
8.52945800.0653--
8.67655900.0648--
8.82356000.06220.09440.7946
8.97066100.0689--
9.11766200.0711--
9.26476300.0611--
9.41186400.0697--
9.55886500.06450.09420.7963
9.70596600.0639--
9.85296700.0643--
10.06800.0644--
10.14716900.0599--
10.29417000.07230.09400.7955
10.44127100.0652--
10.58827200.0646--
10.73537300.0602--
10.88247400.0644--
11.02947500.0660.09380.7971
11.17657600.0624--
11.32357700.0652--
11.47067800.0649--
11.61767900.0624--
11.76478000.06260.09370.7988
11.91188100.0635--
12.05888200.0643--
12.20598300.0663--
12.35298400.0641--
12.58500.06140.09330.8005
12.64718600.0613--
12.79418700.0648--
12.94128800.065--
13.08828900.0589--
13.23539000.06320.09310.7997
13.38249100.0649--
13.52949200.0612--
13.67659300.0634--
13.82359400.0637--
13.97069500.06260.09300.7997
14.11769600.0593--
14.26479700.0662--
14.41189800.0644--
14.55889900.0582--
14.705910000.06260.09270.8013
14.852910100.0605--
15.010200.0615--
15.147110300.0676--
15.294110400.0633--
15.441210500.060.09270.8047
15.588210600.0572--
15.735310700.0579--
15.882410800.0594--
16.029410900.063--
16.176511000.05810.09270.8030
16.323511100.0564--
16.470611200.0632--
16.617611300.065--
16.764711400.0602--
16.911811500.05810.09260.8039
17.058811600.0623--
17.205911700.06--
17.352911800.0562--
17.511900.0627--
17.647112000.0560.09240.8013
17.794112100.0586--
17.941212200.0576--
18.088212300.056--
18.235312400.0611--
18.382412500.05510.09220.8047
18.529412600.058--
18.676512700.0571--
18.823512800.0616--
18.970612900.0599--
19.117613000.06040.09200.8081
19.264713100.0633--
19.411813200.0573--
19.558813300.0549--
19.705913400.0591--
19.852913500.05850.09180.8089
20.013600.057--
20.147113700.057--
20.294113800.0625--
20.441213900.0589--
20.588214000.05770.09180.8098
20.735314100.0583--
20.882414200.0567--
21.029414300.0619--
21.176514400.0572--
21.323514500.05940.09170.8123
21.470614600.0567--
21.617614700.0611--
21.764714800.0533--
21.911814900.0595--
22.058815000.05210.09130.8114
22.205915100.0586--
22.352915200.0603--
22.515300.0601--
22.647115400.0567--
22.794115500.05510.09110.8114
22.941215600.0542--
23.088215700.057--
23.235315800.0541--
23.382415900.0586--
23.529416000.05730.09120.8106
23.676516100.0543--
23.823516200.0578--
23.970616300.0563--
24.117616400.0549--
24.264716500.05490.09090.8140
24.411816600.056--
24.558816700.0599--
24.705916800.0543--
24.852916900.0547--
25.017000.05750.09060.8114
25.147117100.0544--
25.294117200.0574--
25.441217300.0565--
25.588217400.0587--
25.735317500.05590.09050.8157
25.882417600.0551--
26.029417700.0569--
26.176517800.0516--
26.323517900.0561--
26.470618000.05670.09060.8165
26.617618100.0599--
26.764718200.0577--
26.911818300.0532--
27.058818400.0554--
27.205918500.05790.09060.8123
27.352918600.0532--
27.518700.0493--
27.647118800.0552--
27.794118900.0532--
27.941219000.05690.09040.8089
28.088219100.0568--
28.235319200.052--
28.382419300.0555--
28.529419400.0563--
28.676519500.05550.09030.8140
28.823519600.0535--
28.970619700.0525--
29.117619800.0566--
29.264719900.0562--
29.411820000.05470.09020.8140
29.558820100.0495--
29.705920200.0532--
29.852920300.0553--
30.020400.0544--

</details>

Framework Versions

  • —Python: 3.8.18
  • —Sentence Transformers: 3.1.1
  • —Transformers: 4.45.1
  • —PyTorch: 1.13.1+cu117
  • —Accelerate: 0.34.2
  • —Datasets: 3.0.0
  • —Tokenizers: 0.20.0

Citation

BibTeX

Sentence Transformers
bibtex
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
TripletLoss
bibtex
@misc{hermans2017defense,
    title={In Defense of the Triplet Loss for Person Re-Identification},
    author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
    year={2017},
    eprint={1703.07737},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->