File size: 81,275 Bytes
b9a978d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293923a
 
 
 
 
 
 
 
 
 
 
 
 
b9a978d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:412178
- loss:MultipleNegativesRankingLoss
base_model: answerdotai/ModernBERT-base
widget:
- source_sentence: "Clip off all parts from all bounding boxes that are outside of\
    \ the image.\n\n        Returns\n        -------\n        imgaug.BoundingBoxesOnImage\n\
    \            Bounding boxes, clipped to fall within the image dimensions."
  sentences:
  - "def model_best(y1, y2, samples=1000, progressbar=True):\n    \"\"\"\n    Bayesian\
    \ Estimation Supersedes the T-Test\n\n    This model runs a Bayesian hypothesis\
    \ comparing if y1 and y2 come\n    from the same distribution. Returns are assumed\
    \ to be T-distributed.\n\n    In addition, computes annual volatility and Sharpe\
    \ of in and\n    out-of-sample periods.\n\n    This model replicates the example\
    \ used in:\n    Kruschke, John. (2012) Bayesian estimation supersedes the t\n\
    \    test. Journal of Experimental Psychology: General.\n\n    Parameters\n  \
    \  ----------\n    y1 : array-like\n        Array of returns (e.g. in-sample)\n\
    \    y2 : array-like\n        Array of returns (e.g. out-of-sample)\n    samples\
    \ : int, optional\n        Number of posterior samples to draw.\n\n    Returns\n\
    \    -------\n    model : pymc.Model object\n        PyMC3 model containing all\
    \ random variables.\n    trace : pymc3.sampling.BaseTrace object\n        A PyMC3\
    \ trace object that contains samples for each parameter\n        of the posterior.\n\
    \n    See Also\n    --------\n    plot_stoch_vol : plotting of tochastic volatility\
    \ model\n    \"\"\"\n\n    y = np.concatenate((y1, y2))\n\n    mu_m = np.mean(y)\n\
    \    mu_p = 0.000001 * 1 / np.std(y)**2\n\n    sigma_low = np.std(y) / 1000\n\
    \    sigma_high = np.std(y) * 1000\n    with pm.Model() as model:\n        group1_mean\
    \ = pm.Normal('group1_mean', mu=mu_m, tau=mu_p,\n                            \
    \    testval=y1.mean())\n        group2_mean = pm.Normal('group2_mean', mu=mu_m,\
    \ tau=mu_p,\n                                testval=y2.mean())\n        group1_std\
    \ = pm.Uniform('group1_std', lower=sigma_low,\n                              \
    \  upper=sigma_high, testval=y1.std())\n        group2_std = pm.Uniform('group2_std',\
    \ lower=sigma_low,\n                                upper=sigma_high, testval=y2.std())\n\
    \        nu = pm.Exponential('nu_minus_two', 1 / 29., testval=4.) + 2.\n\n   \
    \     returns_group1 = pm.StudentT('group1', nu=nu, mu=group1_mean,\n        \
    \                             lam=group1_std**-2, observed=y1)\n        returns_group2\
    \ = pm.StudentT('group2', nu=nu, mu=group2_mean,\n                           \
    \          lam=group2_std**-2, observed=y2)\n\n        diff_of_means = pm.Deterministic('difference\
    \ of means',\n                                         group2_mean - group1_mean)\n\
    \        pm.Deterministic('difference of stds',\n                         group2_std\
    \ - group1_std)\n        pm.Deterministic('effect size', diff_of_means /\n   \
    \                      pm.math.sqrt((group1_std**2 +\n                       \
    \                group2_std**2) / 2))\n\n        pm.Deterministic('group1_annual_volatility',\n\
    \                         returns_group1.distribution.variance**.5 *\n       \
    \                  np.sqrt(252))\n        pm.Deterministic('group2_annual_volatility',\n\
    \                         returns_group2.distribution.variance**.5 *\n       \
    \                  np.sqrt(252))\n\n        pm.Deterministic('group1_sharpe',\
    \ returns_group1.distribution.mean /\n                         returns_group1.distribution.variance**.5\
    \ *\n                         np.sqrt(252))\n        pm.Deterministic('group2_sharpe',\
    \ returns_group2.distribution.mean /\n                         returns_group2.distribution.variance**.5\
    \ *\n                         np.sqrt(252))\n\n        trace = pm.sample(samples,\
    \ progressbar=progressbar)\n    return model, trace"
  - "def clip_out_of_image(self):\n        \"\"\"\n        Clip off all parts from\
    \ all bounding boxes that are outside of the image.\n\n        Returns\n     \
    \   -------\n        imgaug.BoundingBoxesOnImage\n            Bounding boxes,\
    \ clipped to fall within the image dimensions.\n\n        \"\"\"\n        bbs_cut\
    \ = [bb.clip_out_of_image(self.shape)\n                   for bb in self.bounding_boxes\
    \ if bb.is_partly_within_image(self.shape)]\n        return BoundingBoxesOnImage(bbs_cut,\
    \ shape=self.shape)"
  - "def _initPermanence(self, potential, connectedPct):\n    \"\"\"\n    Initializes\
    \ the permanences of a column. The method\n    returns a 1-D array the size of\
    \ the input, where each entry in the\n    array represents the initial permanence\
    \ value between the input bit\n    at the particular index in the array, and the\
    \ column represented by\n    the 'index' parameter.\n\n    Parameters:\n    ----------------------------\n\
    \    :param potential: A numpy array specifying the potential pool of the column.\n\
    \                    Permanence values will only be generated for input bits\n\
    \                    corresponding to indices for which the mask value is 1.\n\
    \    :param connectedPct: A value between 0 or 1 governing the chance, for each\n\
    \                         permanence, that the initial permanence value will\n\
    \                         be a value that is considered connected.\n    \"\"\"\
    \n    # Determine which inputs bits will start out as connected\n    # to the\
    \ inputs. Initially a subset of the input bits in a\n    # column's potential\
    \ pool will be connected. This number is\n    # given by the parameter \"connectedPct\"\
    \n    perm = numpy.zeros(self._numInputs, dtype=realDType)\n    for i in xrange(self._numInputs):\n\
    \      if (potential[i] < 1):\n        continue\n\n      if (self._random.getReal64()\
    \ <= connectedPct):\n        perm[i] = self._initPermConnected()\n      else:\n\
    \        perm[i] = self._initPermNonConnected()\n\n    # Clip off low values.\
    \ Since we use a sparse representation\n    # to store the permanence values this\
    \ helps reduce memory\n    # requirements.\n    perm[perm < self._synPermTrimThreshold]\
    \ = 0\n\n    return perm"
- source_sentence: "Perform a weighted average over dicts that are each on a different\
    \ node\n    Input: local_name2valcount: dict mapping key -> (value, count)\n \
    \   Returns: key -> mean"
  sentences:
  - "def MotionBlur(k=5, angle=(0, 360), direction=(-1.0, 1.0), order=1, name=None,\
    \ deterministic=False, random_state=None):\n    \"\"\"\n    Augmenter that sharpens\
    \ images and overlays the result with the original image.\n\n    dtype support::\n\
    \n        See ``imgaug.augmenters.convolutional.Convolve``.\n\n    Parameters\n\
    \    ----------\n    k : int or tuple of int or list of int or imgaug.parameters.StochasticParameter,\
    \ optional\n        Kernel size to use.\n\n            * If a single int, then\
    \ that value will be used for the height\n              and width of the kernel.\n\
    \            * If a tuple of two ints ``(a, b)``, then the kernel size will be\n\
    \              sampled from the interval ``[a..b]``.\n            * If a list,\
    \ then a random value will be sampled from that list per image.\n            *\
    \ If a StochasticParameter, then ``N`` samples will be drawn from\n          \
    \    that parameter per ``N`` input images, each representing the kernel\n   \
    \           size for the nth image.\n\n    angle : number or tuple of number or\
    \ list of number or imgaug.parameters.StochasticParameter, optional\n        Angle\
    \ of the motion blur in degrees (clockwise, relative to top center direction).\n\
    \n            * If a number, exactly that value will be used.\n            * If\
    \ a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will\n   \
    \           be sampled per image.\n            * If a list, then a random value\
    \ will be sampled from that list per image.\n            * If a StochasticParameter,\
    \ a value will be sampled from the\n              parameter per image.\n\n   \
    \ direction : number or tuple of number or list of number or imgaug.parameters.StochasticParameter,\
    \ optional\n        Forward/backward direction of the motion blur. Lower values\
    \ towards -1.0 will point the motion blur towards\n        the back (with angle\
    \ provided via `angle`). Higher values towards 1.0 will point the motion blur\
    \ forward.\n        A value of 0.0 leads to a uniformly (but still angled) motion\
    \ blur.\n\n            * If a number, exactly that value will be used.\n     \
    \       * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b``\
    \ will\n              be sampled per image.\n            * If a list, then a random\
    \ value will be sampled from that list per image.\n            * If a StochasticParameter,\
    \ a value will be sampled from the\n              parameter per image.\n\n   \
    \ order : int or iterable of int or imgaug.ALL or imgaug.parameters.StochasticParameter,\
    \ optional\n        Interpolation order to use when rotating the kernel according\
    \ to `angle`.\n        See :func:`imgaug.augmenters.geometric.Affine.__init__`.\n\
    \        Recommended to be ``0`` or ``1``, with ``0`` being faster, but less continuous/smooth\
    \ as `angle` is changed,\n        particularly around multiple of 45 degrees.\n\
    \n    name : None or str, optional\n        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.\n\
    \n    deterministic : bool, optional\n        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.\n\
    \n    random_state : None or int or numpy.random.RandomState, optional\n     \
    \   See :func:`imgaug.augmenters.meta.Augmenter.__init__`.\n\n    Examples\n \
    \   --------\n    >>> aug = iaa.MotionBlur(k=15)\n\n    Create a motion blur augmenter\
    \ with kernel size of 15x15.\n\n    >>> aug = iaa.MotionBlur(k=15, angle=[-45,\
    \ 45])\n\n    Create a motion blur augmenter with kernel size of 15x15 and a blur\
    \ angle of either -45 or 45 degrees (randomly\n    picked per image).\n\n    \"\
    \"\"\n    # TODO allow (1, None) and set to identity matrix if k == 1\n    k_param\
    \ = iap.handle_discrete_param(k, \"k\", value_range=(3, None), tuple_to_uniform=True,\
    \ list_to_choice=True,\n                                        allow_floats=False)\n\
    \    angle_param = iap.handle_continuous_param(angle, \"angle\", value_range=None,\
    \ tuple_to_uniform=True,\n                                              list_to_choice=True)\n\
    \    direction_param = iap.handle_continuous_param(direction, \"direction\", value_range=(-1.0-1e-6,\
    \ 1.0+1e-6),\n                                                  tuple_to_uniform=True,\
    \ list_to_choice=True)\n\n    def create_matrices(image, nb_channels, random_state_func):\n\
    \        # avoid cyclic import between blur and geometric\n        from . import\
    \ geometric as iaa_geometric\n\n        # force discrete for k_sample via int()\
    \ in case of stochastic parameter\n        k_sample = int(k_param.draw_sample(random_state=random_state_func))\n\
    \        angle_sample = angle_param.draw_sample(random_state=random_state_func)\n\
    \        direction_sample = direction_param.draw_sample(random_state=random_state_func)\n\
    \n        k_sample = k_sample if k_sample % 2 != 0 else k_sample + 1\n       \
    \ direction_sample = np.clip(direction_sample, -1.0, 1.0)\n        direction_sample\
    \ = (direction_sample + 1.0) / 2.0\n\n        matrix = np.zeros((k_sample, k_sample),\
    \ dtype=np.float32)\n        matrix[:, k_sample//2] = np.linspace(float(direction_sample),\
    \ 1.0 - float(direction_sample), num=k_sample)\n        rot = iaa_geometric.Affine(rotate=angle_sample,\
    \ order=order)\n        matrix = (rot.augment_image((matrix * 255).astype(np.uint8))\
    \ / 255.0).astype(np.float32)\n\n        return [matrix/np.sum(matrix)] * nb_channels\n\
    \n    if name is None:\n        name = \"Unnamed%s\" % (ia.caller_name(),)\n\n\
    \    return iaa_convolutional.Convolve(create_matrices, name=name, deterministic=deterministic,\n\
    \                                      random_state=random_state)"
  - "def rolling_sharpe(returns, rolling_sharpe_window):\n    \"\"\"\n    Determines\
    \ the rolling Sharpe ratio of a strategy.\n\n    Parameters\n    ----------\n\
    \    returns : pd.Series\n        Daily returns of the strategy, noncumulative.\n\
    \         - See full explanation in tears.create_full_tear_sheet.\n    rolling_sharpe_window\
    \ : int\n        Length of rolling window, in days, over which to compute.\n\n\
    \    Returns\n    -------\n    pd.Series\n        Rolling Sharpe ratio.\n\n  \
    \  Note\n    -----\n    See https://en.wikipedia.org/wiki/Sharpe_ratio for more\
    \ details.\n    \"\"\"\n\n    return returns.rolling(rolling_sharpe_window).mean()\
    \ \\\n        / returns.rolling(rolling_sharpe_window).std() \\\n        * np.sqrt(APPROX_BDAYS_PER_YEAR)"
  - "def mpi_weighted_mean(comm, local_name2valcount):\n    \"\"\"\n    Perform a\
    \ weighted average over dicts that are each on a different node\n    Input: local_name2valcount:\
    \ dict mapping key -> (value, count)\n    Returns: key -> mean\n    \"\"\"\n \
    \   all_name2valcount = comm.gather(local_name2valcount)\n    if comm.rank ==\
    \ 0:\n        name2sum = defaultdict(float)\n        name2count = defaultdict(float)\n\
    \        for n2vc in all_name2valcount:\n            for (name, (val, count))\
    \ in n2vc.items():\n                try:\n                    val = float(val)\n\
    \                except ValueError:\n                    if comm.rank == 0:\n\
    \                        warnings.warn('WARNING: tried to compute mean on non-float\
    \ {}={}'.format(name, val))\n                else:\n                    name2sum[name]\
    \ += val * count\n                    name2count[name] += count\n        return\
    \ {name : name2sum[name] / name2count[name] for name in name2sum}\n    else:\n\
    \        return {}"
- source_sentence: "Generate and return the following encoder related substitution\
    \ variables:\n\n  encoderSpecsStr:\n    For the base description file, this string\
    \ defines the default\n    encoding dicts for each encoder. For example:\n   \
    \      '__gym_encoder' : {   'fieldname': 'gym',\n          'n': 13,\n       \
    \   'name': 'gym',\n          'type': 'SDRCategoryEncoder',\n          'w': 7},\n\
    \        '__address_encoder' : {   'fieldname': 'address',\n          'n': 13,\n\
    \          'name': 'address',\n          'type': 'SDRCategoryEncoder',\n     \
    \     'w': 7}\n\n  encoderSchemaStr:\n    For the base description file, this\
    \ is a list containing a\n    DeferredDictLookup entry for each encoder. For example:\n\
    \        [DeferredDictLookup('__gym_encoder'),\n         DeferredDictLookup('__address_encoder'),\n\
    \         DeferredDictLookup('__timestamp_timeOfDay_encoder'),\n         DeferredDictLookup('__timestamp_dayOfWeek_encoder'),\n\
    \         DeferredDictLookup('__consumption_encoder')],\n\n  permEncoderChoicesStr:\n\
    \    For the permutations file, this defines the possible\n    encoder dicts for\
    \ each encoder. For example:\n        '__timestamp_dayOfWeek_encoder': [\n   \
    \                  None,\n                     {'fieldname':'timestamp',\n   \
    \                   'name': 'timestamp_timeOfDay',\n                      'type':'DateEncoder'\n\
    \                      'dayOfWeek': (7,1)\n                      },\n        \
    \             {'fieldname':'timestamp',\n                      'name': 'timestamp_timeOfDay',\n\
    \                      'type':'DateEncoder'\n                      'dayOfWeek':\
    \ (7,3)\n                      },\n                  ],\n\n        '__field_consumption_encoder':\
    \ [\n                    None,\n                    {'fieldname':'consumption',\n\
    \                     'name': 'consumption',\n                     'type':'AdaptiveScalarEncoder',\n\
    \                     'n': 13,\n                     'w': 7,\n               \
    \       }\n                   ]\n\n\n\n  Parameters:\n  --------------------------------------------------\n\
    \  includedFields:  item from the 'includedFields' section of the\n          \
    \          description JSON object. This is a list of dicts, each\n          \
    \          dict defining the field name, type, and optional min\n            \
    \        and max values.\n\n  retval:  (encoderSpecsStr, encoderSchemaStr permEncoderChoicesStr)"
  sentences:
  - "def _generateEncoderStringsV1(includedFields):\n  \"\"\" Generate and return\
    \ the following encoder related substitution variables:\n\n  encoderSpecsStr:\n\
    \    For the base description file, this string defines the default\n    encoding\
    \ dicts for each encoder. For example:\n         '__gym_encoder' : {   'fieldname':\
    \ 'gym',\n          'n': 13,\n          'name': 'gym',\n          'type': 'SDRCategoryEncoder',\n\
    \          'w': 7},\n        '__address_encoder' : {   'fieldname': 'address',\n\
    \          'n': 13,\n          'name': 'address',\n          'type': 'SDRCategoryEncoder',\n\
    \          'w': 7}\n\n  encoderSchemaStr:\n    For the base description file,\
    \ this is a list containing a\n    DeferredDictLookup entry for each encoder.\
    \ For example:\n        [DeferredDictLookup('__gym_encoder'),\n         DeferredDictLookup('__address_encoder'),\n\
    \         DeferredDictLookup('__timestamp_timeOfDay_encoder'),\n         DeferredDictLookup('__timestamp_dayOfWeek_encoder'),\n\
    \         DeferredDictLookup('__consumption_encoder')],\n\n  permEncoderChoicesStr:\n\
    \    For the permutations file, this defines the possible\n    encoder dicts for\
    \ each encoder. For example:\n        '__timestamp_dayOfWeek_encoder': [\n   \
    \                  None,\n                     {'fieldname':'timestamp',\n   \
    \                   'name': 'timestamp_timeOfDay',\n                      'type':'DateEncoder'\n\
    \                      'dayOfWeek': (7,1)\n                      },\n        \
    \             {'fieldname':'timestamp',\n                      'name': 'timestamp_timeOfDay',\n\
    \                      'type':'DateEncoder'\n                      'dayOfWeek':\
    \ (7,3)\n                      },\n                  ],\n\n        '__field_consumption_encoder':\
    \ [\n                    None,\n                    {'fieldname':'consumption',\n\
    \                     'name': 'consumption',\n                     'type':'AdaptiveScalarEncoder',\n\
    \                     'n': 13,\n                     'w': 7,\n               \
    \       }\n                   ]\n\n\n\n  Parameters:\n  --------------------------------------------------\n\
    \  includedFields:  item from the 'includedFields' section of the\n          \
    \          description JSON object. This is a list of dicts, each\n          \
    \          dict defining the field name, type, and optional min\n            \
    \        and max values.\n\n  retval:  (encoderSpecsStr, encoderSchemaStr permEncoderChoicesStr)\n\
    \n\n  \"\"\"\n\n  # ------------------------------------------------------------------------\n\
    \  # First accumulate the possible choices for each encoder\n  encoderChoicesList\
    \ = []\n  for fieldInfo in includedFields:\n\n    fieldName = fieldInfo['fieldName']\n\
    \n    # Get the list of encoder choices for this field\n    (choicesList, aggFunction)\
    \ = _generateEncoderChoicesV1(fieldInfo)\n    encoderChoicesList.extend(choicesList)\n\
    \n\n  # ------------------------------------------------------------------------\n\
    \  # Generate the string containing the encoder specs and encoder schema. See\n\
    \  #  the function comments for an example of the encoderSpecsStr and\n  #  encoderSchemaStr\n\
    \  #\n  encoderSpecsList = []\n  for encoderChoices in encoderChoicesList:\n \
    \   # Use the last choice as the default in the base file because the 1st is\n\
    \    # often None\n    encoder = encoderChoices[-1]\n\n    # Check for bad characters\n\
    \    for c in _ILLEGAL_FIELDNAME_CHARACTERS:\n      if encoder['name'].find(c)\
    \ >= 0:\n        raise _ExpGeneratorException(\"Illegal character in field: %r\
    \ (%r)\" % (\n          c, encoder['name']))\n\n    encoderSpecsList.append(\"\
    %s: \\n%s%s\" % (\n        _quoteAndEscape(encoder['name']),\n        2*_ONE_INDENT,\n\
    \        pprint.pformat(encoder, indent=2*_INDENT_STEP)))\n\n  encoderSpecsStr\
    \ = ',\\n  '.join(encoderSpecsList)\n\n\n  # ------------------------------------------------------------------------\n\
    \  # Generate the string containing the permutation encoder choices. See the\n\
    \  #  function comments above for an example of the permEncoderChoicesStr\n\n\
    \  permEncoderChoicesList = []\n  for encoderChoices in encoderChoicesList:\n\
    \    permEncoderChoicesList.append(\"%s: %s,\" % (\n        _quoteAndEscape(encoderChoices[-1]['name']),\n\
    \        pprint.pformat(encoderChoices, indent=2*_INDENT_STEP)))\n  permEncoderChoicesStr\
    \ = '\\n'.join(permEncoderChoicesList)\n  permEncoderChoicesStr = _indentLines(permEncoderChoicesStr,\
    \ 1,\n                                       indentFirstLine=False)\n\n  # Return\
    \ results\n  return (encoderSpecsStr, permEncoderChoicesStr)"
  - "def shift(self, top=None, right=None, bottom=None, left=None):\n        \"\"\"\
    \n        Shift/move the line strings from one or more image sides.\n\n      \
    \  Parameters\n        ----------\n        top : None or int, optional\n     \
    \       Amount of pixels by which to shift all bounding boxes from the\n     \
    \       top.\n\n        right : None or int, optional\n            Amount of pixels\
    \ by which to shift all bounding boxes from the\n            right.\n\n      \
    \  bottom : None or int, optional\n            Amount of pixels by which to shift\
    \ all bounding boxes from the\n            bottom.\n\n        left : None or int,\
    \ optional\n            Amount of pixels by which to shift all bounding boxes\
    \ from the\n            left.\n\n        Returns\n        -------\n        imgaug.augmentables.lines.LineStringsOnImage\n\
    \            Shifted line strings.\n\n        \"\"\"\n        lss_new = [ls.shift(top=top,\
    \ right=right, bottom=bottom, left=left)\n                   for ls in self.line_strings]\n\
    \        return LineStringsOnImage(lss_new, shape=self.shape)"
  - "def cross_entropy_reward_loss(logits, actions, rewards, name=None):\n    \"\"\
    \"Calculate the loss for Policy Gradient Network.\n\n    Parameters\n    ----------\n\
    \    logits : tensor\n        The network outputs without softmax. This function\
    \ implements softmax inside.\n    actions : tensor or placeholder\n        The\
    \ agent actions.\n    rewards : tensor or placeholder\n        The rewards.\n\n\
    \    Returns\n    --------\n    Tensor\n        The TensorFlow loss function.\n\
    \n    Examples\n    ----------\n    >>> states_batch_pl = tf.placeholder(tf.float32,\
    \ shape=[None, D])\n    >>> network = InputLayer(states_batch_pl, name='input')\n\
    \    >>> network = DenseLayer(network, n_units=H, act=tf.nn.relu, name='relu1')\n\
    \    >>> network = DenseLayer(network, n_units=3, name='out')\n    >>> probs =\
    \ network.outputs\n    >>> sampling_prob = tf.nn.softmax(probs)\n    >>> actions_batch_pl\
    \ = tf.placeholder(tf.int32, shape=[None])\n    >>> discount_rewards_batch_pl\
    \ = tf.placeholder(tf.float32, shape=[None])\n    >>> loss = tl.rein.cross_entropy_reward_loss(probs,\
    \ actions_batch_pl, discount_rewards_batch_pl)\n    >>> train_op = tf.train.RMSPropOptimizer(learning_rate,\
    \ decay_rate).minimize(loss)\n\n    \"\"\"\n    cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(labels=actions,\
    \ logits=logits, name=name)\n\n    return tf.reduce_sum(tf.multiply(cross_entropy,\
    \ rewards))"
- source_sentence: "Translate an index into coordinates, using the given coordinate\
    \ system.\n\n  Similar to ``numpy.unravel_index``.\n\n  :param index: (int) The\
    \ index of the point. The coordinates are expressed as a \n         single index\
    \ by using the dimensions as a mixed radix definition. For \n         example,\
    \ in dimensions 42x10, the point [1, 4] is index \n         1*420 + 4*10 = 460.\n\
    \n  :param dimensions (list of ints) The coordinate system.\n\n  :returns: (list)\
    \ of coordinates of length ``len(dimensions)``."
  sentences:
  - "def coordinatesFromIndex(index, dimensions):\n  \"\"\"\n  Translate an index\
    \ into coordinates, using the given coordinate system.\n\n  Similar to ``numpy.unravel_index``.\n\
    \n  :param index: (int) The index of the point. The coordinates are expressed\
    \ as a \n         single index by using the dimensions as a mixed radix definition.\
    \ For \n         example, in dimensions 42x10, the point [1, 4] is index \n  \
    \       1*420 + 4*10 = 460.\n\n  :param dimensions (list of ints) The coordinate\
    \ system.\n\n  :returns: (list) of coordinates of length ``len(dimensions)``.\n\
    \  \"\"\"\n  coordinates = [0] * len(dimensions)\n\n  shifted = index\n  for i\
    \ in xrange(len(dimensions) - 1, 0, -1):\n    coordinates[i] = shifted % dimensions[i]\n\
    \    shifted = shifted / dimensions[i]\n\n  coordinates[0] = shifted\n\n  return\
    \ coordinates"
  - "def step(self, observation, **extra_feed):\n        \"\"\"\n        Compute next\
    \ action(s) given the observation(s)\n\n        Parameters:\n        ----------\n\
    \n        observation     observation data (either single or a batch)\n\n    \
    \    **extra_feed    additional data such as state or mask (names of the arguments\
    \ should match the ones in constructor, see __init__)\n\n        Returns:\n  \
    \      -------\n        (action, value estimate, next state, negative log likelihood\
    \ of the action under current policy parameters) tuple\n        \"\"\"\n\n   \
    \     a, v, state, neglogp = self._evaluate([self.action, self.vf, self.state,\
    \ self.neglogp], observation, **extra_feed)\n        if state.size == 0:\n   \
    \         state = None\n        return a, v, state, neglogp"
  - "def pretty_eta(seconds_left):\n    \"\"\"Print the number of seconds in human\
    \ readable format.\n\n    Examples:\n    2 days\n    2 hours and 37 minutes\n\
    \    less than a minute\n\n    Paramters\n    ---------\n    seconds_left: int\n\
    \        Number of seconds to be converted to the ETA\n    Returns\n    -------\n\
    \    eta: str\n        String representing the pretty ETA.\n    \"\"\"\n    minutes_left\
    \ = seconds_left // 60\n    seconds_left %= 60\n    hours_left = minutes_left\
    \ // 60\n    minutes_left %= 60\n    days_left = hours_left // 24\n    hours_left\
    \ %= 24\n\n    def helper(cnt, name):\n        return \"{} {}{}\".format(str(cnt),\
    \ name, ('s' if cnt > 1 else ''))\n\n    if days_left > 0:\n        msg = helper(days_left,\
    \ 'day')\n        if hours_left > 0:\n            msg += ' and ' + helper(hours_left,\
    \ 'hour')\n        return msg\n    if hours_left > 0:\n        msg = helper(hours_left,\
    \ 'hour')\n        if minutes_left > 0:\n            msg += ' and ' + helper(minutes_left,\
    \ 'minute')\n        return msg\n    if minutes_left > 0:\n        return helper(minutes_left,\
    \ 'minute')\n    return 'less than a minute'"
- source_sentence: Validates control dictionary for the experiment context
  sentences:
  - "def load_file_list(path=None, regx='\\.jpg', printable=True, keep_prefix=False):\n\
    \    r\"\"\"Return a file list in a folder by given a path and regular expression.\n\
    \n    Parameters\n    ----------\n    path : str or None\n        A folder path,\
    \ if `None`, use the current directory.\n    regx : str\n        The regx of file\
    \ name.\n    printable : boolean\n        Whether to print the files infomation.\n\
    \    keep_prefix : boolean\n        Whether to keep path in the file name.\n\n\
    \    Examples\n    ----------\n    >>> file_list = tl.files.load_file_list(path=None,\
    \ regx='w1pre_[0-9]+\\.(npz)')\n\n    \"\"\"\n    if path is None:\n        path\
    \ = os.getcwd()\n    file_list = os.listdir(path)\n    return_list = []\n    for\
    \ _, f in enumerate(file_list):\n        if re.search(regx, f):\n            return_list.append(f)\n\
    \    # return_list.sort()\n    if keep_prefix:\n        for i, f in enumerate(return_list):\n\
    \            return_list[i] = os.path.join(path, f)\n\n    if printable:\n   \
    \     logging.info('Match file list = %s' % return_list)\n        logging.info('Number\
    \ of files = %d' % len(return_list))\n    return return_list"
  - "def getCompletingSwarms(self):\n    \"\"\"Return the list of all completing swarms.\n\
    \n    Parameters:\n    ---------------------------------------------------------------------\n\
    \    retval:   list of active swarm Ids\n    \"\"\"\n    swarmIds = []\n    for\
    \ swarmId, info in self._state['swarms'].iteritems():\n      if info['status']\
    \ == 'completing':\n        swarmIds.append(swarmId)\n\n    return swarmIds"
  - "def __validateExperimentControl(self, control):\n    \"\"\" Validates control\
    \ dictionary for the experiment context\"\"\"\n    # Validate task list\n    taskList\
    \ = control.get('tasks', None)\n    if taskList is not None:\n      taskLabelsList\
    \ = []\n\n      for task in taskList:\n        validateOpfJsonValue(task, \"opfTaskSchema.json\"\
    )\n        validateOpfJsonValue(task['taskControl'], \"opfTaskControlSchema.json\"\
    )\n\n        taskLabel = task['taskLabel']\n\n        assert isinstance(taskLabel,\
    \ types.StringTypes), \\\n               \"taskLabel type: %r\" % type(taskLabel)\n\
    \        assert len(taskLabel) > 0, \"empty string taskLabel not is allowed\"\n\
    \n        taskLabelsList.append(taskLabel.lower())\n\n      taskLabelDuplicates\
    \ = filter(lambda x: taskLabelsList.count(x) > 1,\n                          \
    \         taskLabelsList)\n      assert len(taskLabelDuplicates) == 0, \\\n  \
    \           \"Duplcate task labels are not allowed: %s\" % taskLabelDuplicates\n\
    \n    return"
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---

# SentenceTransformer based on answerdotai/ModernBERT-base

This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the code_search_net dataset. It maps sentences & paragraphs to a 768-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:** [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) <!-- at revision 8949b909ec900327062f0ebf497f51aef5e6f0c8 -->
- **Maximum Sequence Length:** 4096 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
    - code_search_net
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->

### Model Sources

- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)

### Full Model Architecture

```
SentenceTransformer(
  (0): Transformer({'max_seq_length': 4096, 'do_lower_case': False}) with Transformer model: ModernBertModel 
  (1): Pooling({'word_embedding_dimension': 768, '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("juanwisz/modernbert-python-code-retrieval")
# Run inference
sentences = [
    'Validates control dictionary for the experiment context',
    'def __validateExperimentControl(self, control):\n    """ Validates control dictionary for the experiment context"""\n    # Validate task list\n    taskList = control.get(\'tasks\', None)\n    if taskList is not None:\n      taskLabelsList = []\n\n      for task in taskList:\n        validateOpfJsonValue(task, "opfTaskSchema.json")\n        validateOpfJsonValue(task[\'taskControl\'], "opfTaskControlSchema.json")\n\n        taskLabel = task[\'taskLabel\']\n\n        assert isinstance(taskLabel, types.StringTypes), \\\n               "taskLabel type: %r" % type(taskLabel)\n        assert len(taskLabel) > 0, "empty string taskLabel not is allowed"\n\n        taskLabelsList.append(taskLabel.lower())\n\n      taskLabelDuplicates = filter(lambda x: taskLabelsList.count(x) > 1,\n                                   taskLabelsList)\n      assert len(taskLabelDuplicates) == 0, \\\n             "Duplcate task labels are not allowed: %s" % taskLabelDuplicates\n\n    return',
    'def load_file_list(path=None, regx=\'\\.jpg\', printable=True, keep_prefix=False):\n    r"""Return a file list in a folder by given a path and regular expression.\n\n    Parameters\n    ----------\n    path : str or None\n        A folder path, if `None`, use the current directory.\n    regx : str\n        The regx of file name.\n    printable : boolean\n        Whether to print the files infomation.\n    keep_prefix : boolean\n        Whether to keep path in the file name.\n\n    Examples\n    ----------\n    >>> file_list = tl.files.load_file_list(path=None, regx=\'w1pre_[0-9]+\\.(npz)\')\n\n    """\n    if path is None:\n        path = os.getcwd()\n    file_list = os.listdir(path)\n    return_list = []\n    for _, f in enumerate(file_list):\n        if re.search(regx, f):\n            return_list.append(f)\n    # return_list.sort()\n    if keep_prefix:\n        for i, f in enumerate(return_list):\n            return_list[i] = os.path.join(path, f)\n\n    if printable:\n        logging.info(\'Match file list = %s\' % return_list)\n        logging.info(\'Number of files = %d\' % len(return_list))\n    return return_list',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# 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.*
-->

<!--
## 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 Dataset

#### code_search_net

* Dataset: code_search_net
* Size: 412,178 training samples
* Columns: <code>query</code> and <code>positive</code>
* Approximate statistics based on the first 1000 samples:
  |         | query                                                                               | positive                                                                              |
  |:--------|:------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------|
  | type    | string                                                                              | string                                                                                |
  | details | <ul><li>min: 4 tokens</li><li>mean: 73.72 tokens</li><li>max: 2258 tokens</li></ul> | <ul><li>min: 46 tokens</li><li>mean: 300.87 tokens</li><li>max: 3119 tokens</li></ul> |
* Samples:
  | query                                                                                                 | positive                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  |:------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | <code>Extracts the list of arguments that start with any of the specified prefix values</code>        | <code>def findArgs(args, prefixes):<br>		"""<br>		Extracts the list of arguments that start with any of the specified prefix values<br>		"""<br>		return list([<br>			arg for arg in args<br>			if len([p for p in prefixes if arg.lower().startswith(p.lower())]) > 0<br>		])</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | <code>Removes any arguments in the supplied list that are contained in the specified blacklist</code> | <code>def stripArgs(args, blacklist):<br>		"""<br>		Removes any arguments in the supplied list that are contained in the specified blacklist<br>		"""<br>		blacklist = [b.lower() for b in blacklist]<br>		return list([arg for arg in args if arg.lower() not in blacklist])</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
  | <code>Executes a child process and captures its output</code>                                         | <code>def capture(command, input=None, cwd=None, shell=False, raiseOnError=False):<br>		"""<br>		Executes a child process and captures its output<br>		"""<br>		<br>		# Attempt to execute the child process<br>		proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd, shell=shell, universal_newlines=True)<br>		(stdout, stderr) = proc.communicate(input)<br>		<br>		# If the child process failed and we were asked to raise an exception, do so<br>		if raiseOnError == True and proc.returncode != 0:<br>			raise Exception(<br>				'child process ' + str(command) +<br>				' failed with exit code ' + str(proc.returncode) +<br>				'\nstdout: "' + stdout + '"' +<br>				'\nstderr: "' + stderr + '"'<br>			)<br>		<br>		return CommandOutput(proc.returncode, stdout, stderr)</code> |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
  ```json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }
  ```

### Evaluation Dataset

#### code_search_net

* Dataset: code_search_net
* Size: 23,107 evaluation samples
* Columns: <code>query</code> and <code>positive</code>
* Approximate statistics based on the first 1000 samples:
  |         | query                                                                                | positive                                                                             |
  |:--------|:-------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
  | type    | string                                                                               | string                                                                               |
  | details | <ul><li>min: 5 tokens</li><li>mean: 168.27 tokens</li><li>max: 2118 tokens</li></ul> | <ul><li>min: 48 tokens</li><li>mean: 467.9 tokens</li><li>max: 4096 tokens</li></ul> |
* Samples:
  | query                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | positive                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | <code>Train a deepq model.<br><br>    Parameters<br>    -------<br>    env: gym.Env<br>        environment to train on<br>    network: string or a function<br>        neural network to use as a q function approximator. If string, has to be one of the names of registered models in baselines.common.models<br>        (mlp, cnn, conv_only). If a function, should take an observation tensor and return a latent variable tensor, which<br>        will be mapped to the Q function heads (see build_q_func in baselines.deepq.models for details on that)<br>    seed: int or None<br>        prng seed. The runs with the same seed "should" give the same results. If None, no seeding is used.<br>    lr: float<br>        learning rate for adam optimizer<br>    total_timesteps: int<br>        number of env steps to optimizer for<br>    buffer_size: int<br>        size of the replay buffer<br>    exploration_fraction: float<br>        fraction of entire training period over which the exploration rate is annealed<br>    exploration_final_eps: float<br>        final value of ra...</code> | <code>def learn(env,<br>          network,<br>          seed=None,<br>          lr=5e-4,<br>          total_timesteps=100000,<br>          buffer_size=50000,<br>          exploration_fraction=0.1,<br>          exploration_final_eps=0.02,<br>          train_freq=1,<br>          batch_size=32,<br>          print_freq=100,<br>          checkpoint_freq=10000,<br>          checkpoint_path=None,<br>          learning_starts=1000,<br>          gamma=1.0,<br>          target_network_update_freq=500,<br>          prioritized_replay=False,<br>          prioritized_replay_alpha=0.6,<br>          prioritized_replay_beta0=0.4,<br>          prioritized_replay_beta_iters=None,<br>          prioritized_replay_eps=1e-6,<br>          param_noise=False,<br>          callback=None,<br>          load_path=None,<br>          **network_kwargs<br>            ):<br>    """Train a deepq model.<br><br>    Parameters<br>    -------<br>    env: gym.Env<br>        environment to train on<br>    network: string or a function<br>        neural network to use as a q function approximator. If string, has to be one of the ...</code> |
  | <code>Save model to a pickle located at `path`</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | <code>def save_act(self, path=None):<br>        """Save model to a pickle located at `path`"""<br>        if path is None:<br>            path = os.path.join(logger.get_dir(), "model.pkl")<br><br>        with tempfile.TemporaryDirectory() as td:<br>            save_variables(os.path.join(td, "model"))<br>            arc_name = os.path.join(td, "packed.zip")<br>            with zipfile.ZipFile(arc_name, 'w') as zipf:<br>                for root, dirs, files in os.walk(td):<br>                    for fname in files:<br>                        file_path = os.path.join(root, fname)<br>                        if file_path != arc_name:<br>                            zipf.write(file_path, os.path.relpath(file_path, td))<br>            with open(arc_name, "rb") as f:<br>                model_data = f.read()<br>        with open(path, "wb") as f:<br>            cloudpickle.dump((model_data, self._act_params), f)</code>                                                                                                                                                                                                 |
  | <code>CNN from Nature paper.</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | <code>def nature_cnn(unscaled_images, **conv_kwargs):<br>    """<br>    CNN from Nature paper.<br>    """<br>    scaled_images = tf.cast(unscaled_images, tf.float32) / 255.<br>    activ = tf.nn.relu<br>    h = activ(conv(scaled_images, 'c1', nf=32, rf=8, stride=4, init_scale=np.sqrt(2),<br>                   **conv_kwargs))<br>    h2 = activ(conv(h, 'c2', nf=64, rf=4, stride=2, init_scale=np.sqrt(2), **conv_kwargs))<br>    h3 = activ(conv(h2, 'c3', nf=64, rf=3, stride=1, init_scale=np.sqrt(2), **conv_kwargs))<br>    h3 = conv_to_fc(h3)<br>    return activ(fc(h3, 'fc1', nh=512, init_scale=np.sqrt(2)))</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
  ```json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }
  ```

### Training Hyperparameters
#### Non-Default Hyperparameters

- `eval_strategy`: epoch
- `per_device_train_batch_size`: 4
- `gradient_accumulation_steps`: 4
- `learning_rate`: 2e-05
- `num_train_epochs`: 10
- `warmup_steps`: 1000
- `fp16`: True

#### All Hyperparameters
<details><summary>Click to expand</summary>

- `overwrite_output_dir`: False
- `do_predict`: False
- `eval_strategy`: epoch
- `prediction_loss_only`: True
- `per_device_train_batch_size`: 4
- `per_device_eval_batch_size`: 8
- `per_gpu_train_batch_size`: None
- `per_gpu_eval_batch_size`: None
- `gradient_accumulation_steps`: 4
- `eval_accumulation_steps`: None
- `torch_empty_cache_steps`: None
- `learning_rate`: 2e-05
- `weight_decay`: 0.0
- `adam_beta1`: 0.9
- `adam_beta2`: 0.999
- `adam_epsilon`: 1e-08
- `max_grad_norm`: 1.0
- `num_train_epochs`: 10
- `max_steps`: -1
- `lr_scheduler_type`: linear
- `lr_scheduler_kwargs`: {}
- `warmup_ratio`: 0.0
- `warmup_steps`: 1000
- `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`: False
- `fp16`: True
- `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`: False
- `dataloader_num_workers`: 0
- `dataloader_prefetch_factor`: None
- `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`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
- `fsdp_transformer_layer_cls_to_wrap`: None
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': 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`: None
- `hub_model_id`: None
- `hub_strategy`: every_save
- `hub_private_repo`: None
- `hub_always_push`: False
- `gradient_checkpointing`: False
- `gradient_checkpointing_kwargs`: None
- `include_inputs_for_metrics`: False
- `include_for_metrics`: []
- `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
- `average_tokens_across_devices`: False
- `prompts`: None
- `batch_sampler`: batch_sampler
- `multi_dataset_batch_sampler`: proportional

</details>

### Training Logs
<details><summary>Click to expand</summary>

| Epoch  | Step  | Training Loss | Validation Loss |
|:------:|:-----:|:-------------:|:---------------:|
| 0.0078 | 200   | 0.634         | -               |
| 0.0155 | 400   | 0.0046        | -               |
| 0.0233 | 600   | 0.0009        | -               |
| 0.0311 | 800   | 0.0004        | -               |
| 0.0388 | 1000  | 0.0001        | -               |
| 0.0466 | 1200  | 0.0002        | -               |
| 0.0543 | 1400  | 0.0001        | -               |
| 0.0621 | 1600  | 0.0001        | -               |
| 0.0699 | 1800  | 0.0001        | -               |
| 0.0776 | 2000  | 0.0           | -               |
| 0.0854 | 2200  | 0.0           | -               |
| 0.0932 | 2400  | 0.0           | -               |
| 0.1009 | 2600  | 0.0           | -               |
| 0.1087 | 2800  | 0.0005        | -               |
| 0.1165 | 3000  | 0.0005        | -               |
| 0.1242 | 3200  | 0.0002        | -               |
| 0.1320 | 3400  | 0.0           | -               |
| 0.1397 | 3600  | 0.0           | -               |
| 0.1475 | 3800  | 0.0           | -               |
| 0.1553 | 4000  | 0.0001        | -               |
| 0.1630 | 4200  | 0.0           | -               |
| 0.1708 | 4400  | 0.0001        | -               |
| 0.1786 | 4600  | 0.0001        | -               |
| 0.1863 | 4800  | 0.0           | -               |
| 0.1941 | 5000  | 0.0           | -               |
| 0.2019 | 5200  | 0.0           | -               |
| 0.2096 | 5400  | 0.0           | -               |
| 0.2174 | 5600  | 0.0           | -               |
| 0.2251 | 5800  | 0.0           | -               |
| 0.2329 | 6000  | 0.0004        | -               |
| 0.2407 | 6200  | 0.0           | -               |
| 0.2484 | 6400  | 0.0001        | -               |
| 0.2562 | 6600  | 0.0           | -               |
| 0.2640 | 6800  | 0.0           | -               |
| 0.2717 | 7000  | 0.0           | -               |
| 0.2795 | 7200  | 0.0           | -               |
| 0.2873 | 7400  | 0.0           | -               |
| 0.2950 | 7600  | 0.0           | -               |
| 0.3028 | 7800  | 0.0           | -               |
| 0.3105 | 8000  | 0.0           | -               |
| 0.3183 | 8200  | 0.0           | -               |
| 0.3261 | 8400  | 0.0004        | -               |
| 0.3338 | 8600  | 0.0           | -               |
| 0.3416 | 8800  | 0.0           | -               |
| 0.3494 | 9000  | 0.0           | -               |
| 0.3571 | 9200  | 0.0           | -               |
| 0.3649 | 9400  | 0.0           | -               |
| 0.3727 | 9600  | 0.0           | -               |
| 0.3804 | 9800  | 0.0           | -               |
| 0.3882 | 10000 | 0.0           | -               |
| 0.3959 | 10200 | 0.0           | -               |
| 0.4037 | 10400 | 0.0           | -               |
| 0.4115 | 10600 | 0.0           | -               |
| 0.4192 | 10800 | 0.0           | -               |
| 0.4270 | 11000 | 0.0           | -               |
| 0.4348 | 11200 | 0.0           | -               |
| 0.4425 | 11400 | 0.0           | -               |
| 0.4503 | 11600 | 0.0           | -               |
| 0.4581 | 11800 | 0.0           | -               |
| 0.4658 | 12000 | 0.0           | -               |
| 0.4736 | 12200 | 0.0           | -               |
| 0.4813 | 12400 | 0.0           | -               |
| 0.4891 | 12600 | 0.0005        | -               |
| 0.4969 | 12800 | 0.0           | -               |
| 0.5046 | 13000 | 0.0           | -               |
| 0.5124 | 13200 | 0.0001        | -               |
| 0.5202 | 13400 | 0.0           | -               |
| 0.5279 | 13600 | 0.0           | -               |
| 0.5357 | 13800 | 0.0           | -               |
| 0.5435 | 14000 | 0.0           | -               |
| 0.5512 | 14200 | 0.0           | -               |
| 0.5590 | 14400 | 0.0004        | -               |
| 0.5667 | 14600 | 0.0           | -               |
| 0.5745 | 14800 | 0.0           | -               |
| 0.5823 | 15000 | 0.0           | -               |
| 0.5900 | 15200 | 0.0           | -               |
| 0.5978 | 15400 | 0.0           | -               |
| 0.6056 | 15600 | 0.0           | -               |
| 0.6133 | 15800 | 0.0           | -               |
| 0.6211 | 16000 | 0.0           | -               |
| 0.6289 | 16200 | 0.0           | -               |
| 0.6366 | 16400 | 0.0006        | -               |
| 0.6444 | 16600 | 0.0           | -               |
| 0.6521 | 16800 | 0.0005        | -               |
| 0.6599 | 17000 | 0.0           | -               |
| 0.6677 | 17200 | 0.0           | -               |
| 0.6754 | 17400 | 0.0           | -               |
| 0.6832 | 17600 | 0.0           | -               |
| 0.6910 | 17800 | 0.0           | -               |
| 0.6987 | 18000 | 0.0005        | -               |
| 0.7065 | 18200 | 0.0001        | -               |
| 0.7143 | 18400 | 0.0           | -               |
| 0.7220 | 18600 | 0.0           | -               |
| 0.7298 | 18800 | 0.0           | -               |
| 0.7375 | 19000 | 0.0           | -               |
| 0.7453 | 19200 | 0.0           | -               |
| 0.7531 | 19400 | 0.0           | -               |
| 0.7608 | 19600 | 0.0           | -               |
| 0.7686 | 19800 | 0.0001        | -               |
| 0.7764 | 20000 | 0.0           | -               |
| 0.7841 | 20200 | 0.0           | -               |
| 0.7919 | 20400 | 0.0           | -               |
| 0.7997 | 20600 | 0.0004        | -               |
| 0.8074 | 20800 | 0.0           | -               |
| 0.8152 | 21000 | 0.0           | -               |
| 0.8229 | 21200 | 0.0           | -               |
| 0.8307 | 21400 | 0.0009        | -               |
| 0.8385 | 21600 | 0.0           | -               |
| 0.8462 | 21800 | 0.0           | -               |
| 0.8540 | 22000 | 0.0           | -               |
| 0.8618 | 22200 | 0.0           | -               |
| 0.8695 | 22400 | 0.0002        | -               |
| 0.8773 | 22600 | 0.0           | -               |
| 0.8851 | 22800 | 0.0           | -               |
| 0.8928 | 23000 | 0.0001        | -               |
| 0.9006 | 23200 | 0.0           | -               |
| 0.9083 | 23400 | 0.0           | -               |
| 0.9161 | 23600 | 0.0           | -               |
| 0.9239 | 23800 | 0.0           | -               |
| 0.9316 | 24000 | 0.0           | -               |
| 0.9394 | 24200 | 0.0           | -               |
| 0.9472 | 24400 | 0.0           | -               |
| 0.9549 | 24600 | 0.0           | -               |
| 0.9627 | 24800 | 0.0           | -               |
| 0.9704 | 25000 | 0.0           | -               |
| 0.9782 | 25200 | 0.0           | -               |
| 0.9860 | 25400 | 0.0           | -               |
| 0.9937 | 25600 | 0.0           | -               |
| 1.0    | 25762 | -             | 0.0001          |
| 1.0015 | 25800 | 0.0005        | -               |
| 1.0092 | 26000 | 0.0           | -               |
| 1.0170 | 26200 | 0.0           | -               |
| 1.0248 | 26400 | 0.0           | -               |
| 1.0325 | 26600 | 0.0           | -               |
| 1.0403 | 26800 | 0.0           | -               |
| 1.0481 | 27000 | 0.0           | -               |
| 1.0558 | 27200 | 0.0           | -               |
| 1.0636 | 27400 | 0.0           | -               |
| 1.0713 | 27600 | 0.0           | -               |
| 1.0791 | 27800 | 0.0           | -               |
| 1.0869 | 28000 | 0.0           | -               |
| 1.0946 | 28200 | 0.0           | -               |
| 1.1024 | 28400 | 0.0           | -               |
| 1.1102 | 28600 | 0.0           | -               |
| 1.1179 | 28800 | 0.0           | -               |
| 1.1257 | 29000 | 0.0           | -               |
| 1.1335 | 29200 | 0.0           | -               |
| 1.1412 | 29400 | 0.0           | -               |
| 1.1490 | 29600 | 0.0           | -               |
| 1.1567 | 29800 | 0.0           | -               |
| 1.1645 | 30000 | 0.0           | -               |
| 1.1723 | 30200 | 0.0           | -               |
| 1.1800 | 30400 | 0.0           | -               |
| 1.1878 | 30600 | 0.0           | -               |
| 1.1956 | 30800 | 0.0           | -               |
| 1.2033 | 31000 | 0.0           | -               |
| 1.2111 | 31200 | 0.0           | -               |
| 1.2189 | 31400 | 0.0           | -               |
| 1.2266 | 31600 | 0.0004        | -               |
| 1.2344 | 31800 | 0.0004        | -               |
| 1.2421 | 32000 | 0.0           | -               |
| 1.2499 | 32200 | 0.0           | -               |
| 1.2577 | 32400 | 0.0           | -               |
| 1.2654 | 32600 | 0.0           | -               |
| 1.2732 | 32800 | 0.0           | -               |
| 1.2810 | 33000 | 0.0           | -               |
| 1.2887 | 33200 | 0.0           | -               |
| 1.2965 | 33400 | 0.0           | -               |
| 1.3043 | 33600 | 0.0           | -               |
| 1.3120 | 33800 | 0.0           | -               |
| 1.3198 | 34000 | 0.0           | -               |
| 1.3275 | 34200 | 0.0           | -               |
| 1.3353 | 34400 | 0.0           | -               |
| 1.3431 | 34600 | 0.0           | -               |
| 1.3508 | 34800 | 0.0004        | -               |
| 1.3586 | 35000 | 0.0005        | -               |
| 1.3664 | 35200 | 0.0004        | -               |
| 1.3741 | 35400 | 0.0011        | -               |
| 1.3819 | 35600 | 0.0           | -               |
| 1.3897 | 35800 | 0.0           | -               |
| 1.3974 | 36000 | 0.0           | -               |
| 1.4052 | 36200 | 0.0           | -               |
| 1.4129 | 36400 | 0.0           | -               |
| 1.4207 | 36600 | 0.0           | -               |
| 1.4285 | 36800 | 0.0           | -               |
| 1.4362 | 37000 | 0.0           | -               |
| 1.4440 | 37200 | 0.0001        | -               |
| 1.4518 | 37400 | 0.0           | -               |
| 1.4595 | 37600 | 0.0           | -               |
| 1.4673 | 37800 | 0.0           | -               |
| 1.4751 | 38000 | 0.0           | -               |
| 1.4828 | 38200 | 0.0004        | -               |
| 1.4906 | 38400 | 0.0003        | -               |
| 1.4983 | 38600 | 0.0           | -               |
| 1.5061 | 38800 | 0.0           | -               |
| 1.5139 | 39000 | 0.0           | -               |
| 1.5216 | 39200 | 0.0           | -               |
| 1.5294 | 39400 | 0.0004        | -               |
| 1.5372 | 39600 | 0.0004        | -               |
| 1.5449 | 39800 | 0.0           | -               |
| 1.5527 | 40000 | 0.0           | -               |
| 1.5605 | 40200 | 0.0           | -               |
| 1.5682 | 40400 | 0.0           | -               |
| 1.5760 | 40600 | 0.0009        | -               |
| 1.5837 | 40800 | 0.0           | -               |
| 1.5915 | 41000 | 0.0009        | -               |
| 1.5993 | 41200 | 0.0           | -               |
| 1.6070 | 41400 | 0.0           | -               |
| 1.6148 | 41600 | 0.0           | -               |
| 1.6226 | 41800 | 0.0           | -               |
| 1.6303 | 42000 | 0.0           | -               |
| 1.6381 | 42200 | 0.0           | -               |
| 1.6459 | 42400 | 0.0           | -               |
| 1.6536 | 42600 | 0.0           | -               |
| 1.6614 | 42800 | 0.0           | -               |
| 1.6691 | 43000 | 0.0           | -               |
| 1.6769 | 43200 | 0.0           | -               |
| 1.6847 | 43400 | 0.0           | -               |
| 1.6924 | 43600 | 0.0           | -               |
| 1.7002 | 43800 | 0.0           | -               |
| 1.7080 | 44000 | 0.0           | -               |
| 1.7157 | 44200 | 0.0           | -               |
| 1.7235 | 44400 | 0.0           | -               |
| 1.7313 | 44600 | 0.0           | -               |
| 1.7390 | 44800 | 0.0           | -               |
| 1.7468 | 45000 | 0.0           | -               |
| 1.7545 | 45200 | 0.0           | -               |
| 1.7623 | 45400 | 0.0           | -               |
| 1.7701 | 45600 | 0.0           | -               |
| 1.7778 | 45800 | 0.0           | -               |
| 1.7856 | 46000 | 0.0           | -               |
| 1.7934 | 46200 | 0.0           | -               |
| 1.8011 | 46400 | 0.0           | -               |
| 1.8089 | 46600 | 0.0           | -               |
| 1.8167 | 46800 | 0.0           | -               |
| 1.8244 | 47000 | 0.0           | -               |
| 1.8322 | 47200 | 0.0           | -               |
| 1.8399 | 47400 | 0.0           | -               |
| 1.8477 | 47600 | 0.0           | -               |
| 1.8555 | 47800 | 0.0004        | -               |
| 1.8632 | 48000 | 0.0           | -               |
| 1.8710 | 48200 | 0.0           | -               |
| 1.8788 | 48400 | 0.0           | -               |
| 1.8865 | 48600 | 0.0           | -               |
| 1.8943 | 48800 | 0.0           | -               |
| 1.9021 | 49000 | 0.0004        | -               |
| 1.9098 | 49200 | 0.0           | -               |
| 1.9176 | 49400 | 0.0           | -               |
| 1.9253 | 49600 | 0.0004        | -               |
| 1.9331 | 49800 | 0.0           | -               |
| 1.9409 | 50000 | 0.0           | -               |
| 1.9486 | 50200 | 0.0           | -               |
| 1.9564 | 50400 | 0.0           | -               |
| 1.9642 | 50600 | 0.0004        | -               |
| 1.9719 | 50800 | 0.0           | -               |
| 1.9797 | 51000 | 0.0           | -               |
| 1.9875 | 51200 | 0.0           | -               |
| 1.9952 | 51400 | 0.0004        | -               |
| 2.0    | 51524 | -             | 0.0001          |
| 2.0030 | 51600 | 0.0           | -               |
| 2.0107 | 51800 | 0.0           | -               |
| 2.0185 | 52000 | 0.0           | -               |
| 2.0262 | 52200 | 0.0           | -               |
| 2.0340 | 52400 | 0.0004        | -               |
| 2.0418 | 52600 | 0.0004        | -               |
| 2.0495 | 52800 | 0.0           | -               |
| 2.0573 | 53000 | 0.0008        | -               |
| 2.0651 | 53200 | 0.0           | -               |
| 2.0728 | 53400 | 0.0           | -               |
| 2.0806 | 53600 | 0.0           | -               |
| 2.0883 | 53800 | 0.0           | -               |
| 2.0961 | 54000 | 0.0           | -               |
| 2.1039 | 54200 | 0.0           | -               |
| 2.1116 | 54400 | 0.0           | -               |
| 2.1194 | 54600 | 0.0           | -               |
| 2.1272 | 54800 | 0.0           | -               |
| 2.1349 | 55000 | 0.0           | -               |
| 2.1427 | 55200 | 0.0           | -               |
| 2.1505 | 55400 | 0.0           | -               |
| 2.1582 | 55600 | 0.0           | -               |
| 2.1660 | 55800 | 0.0           | -               |
| 2.1737 | 56000 | 0.0           | -               |
| 2.1815 | 56200 | 0.0           | -               |
| 2.1893 | 56400 | 0.0           | -               |
| 2.1970 | 56600 | 0.0           | -               |
| 2.2048 | 56800 | 0.0           | -               |
| 2.2126 | 57000 | 0.0           | -               |
| 2.2203 | 57200 | 0.0           | -               |
| 2.2281 | 57400 | 0.0           | -               |
| 2.2359 | 57600 | 0.0           | -               |
| 2.2436 | 57800 | 0.0           | -               |
| 2.2514 | 58000 | 0.0004        | -               |
| 2.2591 | 58200 | 0.0           | -               |
| 2.2669 | 58400 | 0.0004        | -               |
| 2.2747 | 58600 | 0.0           | -               |
| 2.2824 | 58800 | 0.0           | -               |
| 2.2902 | 59000 | 0.0           | -               |
| 2.2980 | 59200 | 0.0           | -               |
| 2.3057 | 59400 | 0.0           | -               |
| 2.3135 | 59600 | 0.0           | -               |
| 2.3213 | 59800 | 0.0004        | -               |
| 2.3290 | 60000 | 0.0           | -               |
| 2.3368 | 60200 | 0.0004        | -               |
| 2.3445 | 60400 | 0.0           | -               |
| 2.3523 | 60600 | 0.0           | -               |
| 2.3601 | 60800 | 0.0           | -               |
| 2.3678 | 61000 | 0.0           | -               |
| 2.3756 | 61200 | 0.0           | -               |
| 2.3834 | 61400 | 0.0           | -               |
| 2.3911 | 61600 | 0.0           | -               |
| 2.3989 | 61800 | 0.0           | -               |
| 2.4067 | 62000 | 0.0005        | -               |
| 2.4144 | 62200 | 0.0           | -               |
| 2.4222 | 62400 | 0.0           | -               |
| 2.4299 | 62600 | 0.0           | -               |
| 2.4377 | 62800 | 0.0           | -               |
| 2.4455 | 63000 | 0.0           | -               |
| 2.4532 | 63200 | 0.0           | -               |
| 2.4610 | 63400 | 0.0           | -               |
| 2.4688 | 63600 | 0.0           | -               |
| 2.4765 | 63800 | 0.0           | -               |
| 2.4843 | 64000 | 0.0           | -               |
| 2.4921 | 64200 | 0.0           | -               |
| 2.4998 | 64400 | 0.0           | -               |
| 2.5076 | 64600 | 0.0           | -               |
| 2.5153 | 64800 | 0.0           | -               |
| 2.5231 | 65000 | 0.0           | -               |
| 2.5309 | 65200 | 0.0           | -               |
| 2.5386 | 65400 | 0.0           | -               |
| 2.5464 | 65600 | 0.0004        | -               |
| 2.5542 | 65800 | 0.0           | -               |
| 2.5619 | 66000 | 0.0           | -               |
| 2.5697 | 66200 | 0.0           | -               |
| 2.5775 | 66400 | 0.0           | -               |
| 2.5852 | 66600 | 0.0           | -               |
| 2.5930 | 66800 | 0.0           | -               |
| 2.6007 | 67000 | 0.0           | -               |
| 2.6085 | 67200 | 0.0           | -               |
| 2.6163 | 67400 | 0.0           | -               |
| 2.6240 | 67600 | 0.0           | -               |
| 2.6318 | 67800 | 0.0           | -               |
| 2.6396 | 68000 | 0.0           | -               |
| 2.6473 | 68200 | 0.0           | -               |
| 2.6551 | 68400 | 0.0           | -               |
| 2.6629 | 68600 | 0.0           | -               |
| 2.6706 | 68800 | 0.0004        | -               |
| 2.6784 | 69000 | 0.0           | -               |
| 2.6861 | 69200 | 0.0           | -               |
| 2.6939 | 69400 | 0.0           | -               |
| 2.7017 | 69600 | 0.0004        | -               |
| 2.7094 | 69800 | 0.0004        | -               |
| 2.7172 | 70000 | 0.0           | -               |
| 2.7250 | 70200 | 0.0           | -               |
| 2.7327 | 70400 | 0.0           | -               |
| 2.7405 | 70600 | 0.0           | -               |
| 2.7483 | 70800 | 0.0           | -               |
| 2.7560 | 71000 | 0.0004        | -               |
| 2.7638 | 71200 | 0.0           | -               |
| 2.7715 | 71400 | 0.0           | -               |
| 2.7793 | 71600 | 0.0           | -               |
| 2.7871 | 71800 | 0.0           | -               |
| 2.7948 | 72000 | 0.0           | -               |
| 2.8026 | 72200 | 0.0           | -               |
| 2.8104 | 72400 | 0.0           | -               |
| 2.8181 | 72600 | 0.0           | -               |
| 2.8259 | 72800 | 0.0           | -               |
| 2.8337 | 73000 | 0.0004        | -               |
| 2.8414 | 73200 | 0.0           | -               |
| 2.8492 | 73400 | 0.0           | -               |
| 2.8569 | 73600 | 0.0           | -               |
| 2.8647 | 73800 | 0.0004        | -               |
| 2.8725 | 74000 | 0.0           | -               |
| 2.8802 | 74200 | 0.0           | -               |
| 2.8880 | 74400 | 0.0           | -               |
| 2.8958 | 74600 | 0.0           | -               |
| 2.9035 | 74800 | 0.0           | -               |
| 2.9113 | 75000 | 0.0           | -               |
| 2.9191 | 75200 | 0.0           | -               |
| 2.9268 | 75400 | 0.0004        | -               |
| 2.9346 | 75600 | 0.0           | -               |
| 2.9423 | 75800 | 0.0           | -               |
| 2.9501 | 76000 | 0.0           | -               |
| 2.9579 | 76200 | 0.0           | -               |
| 2.9656 | 76400 | 0.0           | -               |
| 2.9734 | 76600 | 0.0004        | -               |
| 2.9812 | 76800 | 0.0           | -               |
| 2.9889 | 77000 | 0.0           | -               |
| 2.9967 | 77200 | 0.0           | -               |
| 3.0    | 77286 | -             | 0.0000          |

</details>

### Framework Versions
- Python: 3.11.11
- Sentence Transformers: 3.3.1
- Transformers: 4.48.0
- PyTorch: 2.5.1+cu121
- Accelerate: 1.2.1
- Datasets: 3.2.0
- Tokenizers: 0.21.0

## Citation

### BibTeX

#### ModernBERT
```bibtex
@misc{warner2024smarterbetterfasterlonger,
      title={Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference}, 
      author={Benjamin Warner and Antoine Chaffin and Benjamin Clavié and Orion Weller and Oskar Hallström and Said Taghadouini and Alexis Gallagher and Raja Biswas and Faisal Ladhak and Tom Aarsen and Nathan Cooper and Griffin Adams and Jeremy Howard and Iacopo Poli},
      year={2024},
      eprint={2412.13663},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.13663}, 
}
```

#### 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",
}
```

#### MultipleNegativesRankingLoss
```bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
```

<!--
## 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.*
-->