Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 384, 'do_lower_case': False}) with Transformer model: MPNetModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("BoghdadyJR/al-MiniLM-L6-v2")
5# Run inference
6sentences = [
7 'Keypoint.copy',
8 'def copy(self, x=None, y=None):\n """\n Create a shallow copy of the Keypoint object.\n\n Parameters\n ----------\n x : None or number, optional\n Coordinate of the keypoint on the x axis.\n If ``None``, the instance\'s value will be copied.\n\n y : None or number, optional\n Coordinate of the keypoint on the y axis.\n If ``None``, the instance\'s value will be copied.\n\n Returns\n -------\n imgaug.Keypoint\n Shallow copy.\n\n """\n return self.deepcopy(x=x, y=y)',
9 'def build_words_dataset(words=None, vocabulary_size=50000, printable=True, unk_key=\'UNK\'):\n """Build the words dictionary and replace rare words with \'UNK\' token.\n The most common word has the smallest integer id.\n\n Parameters\n ----------\n words : list of str or byte\n The context in list format. You may need to do preprocessing on the words, such as lower case, remove marks etc.\n vocabulary_size : int\n The maximum vocabulary size, limiting the vocabulary size. Then the script replaces rare words with \'UNK\' token.\n printable : boolean\n Whether to print the read vocabulary size of the given words.\n unk_key : str\n Represent the unknown words.\n\n Returns\n --------\n data : list of int\n The context in a list of ID.\n count : list of tuple and list\n Pair words and IDs.\n - count[0] is a list : the number of rare words\n - count[1:] are tuples : the number of occurrence of each word\n - e.g. [[\'UNK\', 418391], (b\'the\', 1061396), (b\'of\', 593677), (b\'and\', 416629), (b\'one\', 411764)]\n dictionary : dictionary\n It is `word_to_id` that maps word to ID.\n reverse_dictionary : a dictionary\n It is `id_to_word` that maps ID to word.\n\n Examples\n --------\n >>> words = tl.files.load_matt_mahoney_text8_dataset()\n >>> vocabulary_size = 50000\n >>> data, count, dictionary, reverse_dictionary = tl.nlp.build_words_dataset(words, vocabulary_size)\n\n References\n -----------------\n - `tensorflow/examples/tutorials/word2vec/word2vec_basic.py <https://github.com/tensorflow/tensorflow/blob/r0.7/tensorflow/examples/tutorials/word2vec/word2vec_basic.py>`__\n\n """\n if words is None:\n raise Exception("words : list of str or byte")\n\n count = [[unk_key, -1]]\n count.extend(collections.Counter(words).most_common(vocabulary_size - 1))\n dictionary = dict()\n for word, _ in count:\n dictionary[word] = len(dictionary)\n data = list()\n unk_count = 0\n for word in words:\n if word in dictionary:\n index = dictionary[word]\n else:\n index = 0 # dictionary[\'UNK\']\n unk_count += 1\n data.append(index)\n count[0][1] = unk_count\n reverse_dictionary = dict(zip(dictionary.values(), dictionary.keys()))\n if printable:\n tl.logging.info(\'Real vocabulary size %d\' % len(collections.Counter(words).keys()))\n tl.logging.info(\'Limited vocabulary size {}\'.format(vocabulary_size))\n if len(collections.Counter(words).keys()) < vocabulary_size:\n raise Exception(\n "len(collections.Counter(words).keys()) >= vocabulary_size , the limited vocabulary_size must be less than or equal to the read vocabulary_size"\n )\n return data, count, dictionary, reverse_dictionary',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]sts-devEmbeddingSimilarityEvaluator| Metric | Value |
|---|---|
| pearson_cosine | 0.8806 |
| spearman_cosine | 0.881 |
| pearson_manhattan | 0.8781 |
| spearman_manhattan | 0.8798 |
| pearson_euclidean | 0.8794 |
| spearman_euclidean | 0.881 |
| pearson_dot | 0.8806 |
| spearman_dot | 0.881 |
| pearson_max | 0.8806 |
| spearman_max | 0.881 |
func_name and whole_func_string| func_name | whole_func_string | |
|---|---|---|
| type | string | string |
| details |
|
|
| func_name | whole_func_string |
|---|---|
ImageGraphCut.__msgc_step3_discontinuity_localization | def __msgc_step3_discontinuity_localization(self):[object Object] """[object Object] Estimate discontinuity in basis of low resolution image segmentation.[object Object] :return: discontinuity in low resolution[object Object] """[object Object] import scipy[object Object][object Object] start = self._start_time[object Object] seg = 1 - self.segmentation.astype(np.int8)[object Object] self.stats["low level object voxels"] = np.sum(seg)[object Object] self.stats["low level image voxels"] = np.prod(seg.shape)[object Object] # in seg is now stored low resolution segmentation[object Object] # back to normal parameters[object Object] # step 2: discontinuity localization[object Object] # self.segparams = sparams_hi[object Object] seg_border = scipy.ndimage.filters.laplace(seg, mode="constant")[object Object] logger.debug("seg_border: %s", scipy.stats.describe(seg_border, axis=None))[object Object] # logger.debug(str(np.max(seg_border)))[object Object] # logger.debug(str(np.min(seg_border)))[object Object] seg_border[seg_border != 0] = 1[object Object] logger.debug("seg_border: %s", scipy.stats.describe(seg_border, axis=None))[object Object] # scipy.ndimage.morphology.distance_transform_edt[object Object] boundary_dilatation_distance = self.segparams["boundary_dilatation_distance"][object Object] seg = scipy.ndimage.morphology.binary_dilation([object Object] seg_border,[object Object] # seg,[object Object] np.ones([object Object] [[object Object] (boundary_dilatation_distance * 2) + 1,[object Object] (boundary_dilatation_distance * 2) + 1,[object Object] (boundary_dilatation_distance * 2) + 1,[object Object] ][object Object] ),[object Object] )[object Object] if self.keep_temp_properties:[object Object] self.temp_msgc_lowres_discontinuity = seg[object Object] else:[object Object] self.temp_msgc_lowres_discontinuity = None[object Object][object Object] if self.debug_images:[object Object] import sed3[object Object][object Object] pd = sed3.sed3(seg_border) # ), contour=seg)[object Object] pd.show()[object Object] pd = sed3.sed3(seg) # ), contour=seg)[object Object] pd.show()[object Object] # segzoom = scipy.ndimage.interpolation.zoom(seg.astype('float'), zoom,[object Object] # order=0).astype('int8')[object Object] self.stats["t3"] = time.time() - start[object Object] return seg |
ImageGraphCut.__multiscale_gc_lo2hi_run | def __multiscale_gc_lo2hi_run(self): # , pyed):[object Object] """[object Object] Run Graph-Cut segmentation with refinement of low resolution multiscale graph.[object Object] In first step is performed normal GC on low resolution data[object Object] Second step construct finer grid on edges of segmentation from first[object Object] step.[object Object] There is no option for use without [object Object][object Object] """[object Object] # from PyQt4.QtCore import pyqtRemoveInputHook[object Object] # pyqtRemoveInputHook()[object Object] self._msgc_lo2hi_resize_init()[object Object] self.__msgc_step0_init()[object Object][object Object] hard_constraints = self.__msgc_step12_low_resolution_segmentation()[object Object] # ===== high resolution data processing[object Object] seg = self.__msgc_step3_discontinuity_localization()[object Object][object Object] self.stats["t3.1"] = (time.time() - self._start_time)[object Object] graph = Graph([object Object] seg,[object Object] voxelsize=self.voxelsize,[object Object] nsplit=self.segparams["block_size"],[object Object] edge_weight_table=self._msgc_npenalty_table,[object Object] compute_low_nodes_index=True,[object Object] )[object Object][object Object] # graph.run() = graph.generate_base_grid() + graph.split_voxels()[object Object] # graph.run()[object Object] graph.generate_base_grid()[object Object] self.stats["t3.2"] = (time.time() - self._start_time)[object Object] graph.split_voxels()[object Object][object Object] self.stats["t3.3"] = (time.time() - self._start_time)[object Object][object Object] self.stats.update(graph.stats)[object Object] self.stats["t4"] = (time.time() - self._start_time)[object Object] mul_mask, mul_val = self.__msgc_tlinks_area_weight_from_low_segmentation(seg)[object Object] area_weight = 1[object Object] unariesalt = self.__create_tlinks([object Object] self.img,[object Object] self.voxelsize,[object Object] self.seeds,[object Object] area_weight=area_weight,[object Object] hard_constraints=hard_constraints,[object Object] mul_mask=None,[object Object] mul_val=None,[object Object] )[object Object] # N-links prepared[object Object] self.stats["t5"] = (time.time() - self._start_time)[object Object] un, ind = np.unique(graph.msinds, return_index=True)[object Object] self.stats["t6"] = (time.time() - self._start_time)[object Object][object Object] self.stats["t7"] = (time.time() - self._start_time)[object Object] unariesalt2_lo2hi = np.hstack([object Object] [unariesalt[ind, 0, 0].reshape(-1, 1), unariesalt[ind, 0, 1].reshape(-1, 1)][object Object] )[object Object] nlinks_lo2hi = np.hstack([graph.edges, graph.edges_weights.reshape(-1, 1)])[object Object] if self.debug_images:[object Object] import sed3[object Object][object Object] ed = sed3.sed3(unariesalt[:, :, 0].reshape(self.img.shape))[object Object] ed.show()[object Object] import sed3[object Object][object Object] ed = sed3.sed3(unariesalt[:, :, 1].reshape(self.img.shape))[object Object] ed.show()[object Object] # ed = sed3.sed3(seg)[object Object] # ed.show()[object Object] # import sed3[object Object] # ed = sed3.sed3(graph.data)[object Object] # ed.show()[object Object] # import sed3[object Object] # ed = sed3.sed3(graph.msinds)[object Object] # ed.show()[object Object][object Object] # nlinks, unariesalt2, msinds = self.__msgc_step45678_construct_graph(area_weight, hard_constraints, seg)[object Object] # self.__msgc_step9_finish_perform_gc_and_reshape(nlinks, unariesalt2, msinds)[object Object] self.__msgc_step9_finish_perform_gc_and_reshape([object Object] nlinks_lo2hi, unariesalt2_lo2hi, graph.msinds[object Object] )[object Object] self._msgc_lo2hi_resize_clean_finish() |
ImageGraphCut.__multiscale_gc_hi2lo_run | def __multiscale_gc_hi2lo_run(self): # , pyed):[object Object] """[object Object] Run Graph-Cut segmentation with simplifiyng of high resolution multiscale graph.[object Object] In first step is performed normal GC on low resolution data[object Object] Second step construct finer grid on edges of segmentation from first[object Object] step.[object Object] There is no option for use without [object Object][object Object] """[object Object] # from PyQt4.QtCore import pyqtRemoveInputHook[object Object] # pyqtRemoveInputHook()[object Object][object Object] self.__msgc_step0_init()[object Object] hard_constraints = self.__msgc_step12_low_resolution_segmentation()[object Object] # ===== high resolution data processing[object Object] seg = self.__msgc_step3_discontinuity_localization()[object Object] nlinks, unariesalt2, msinds = self.__msgc_step45678_hi2lo_construct_graph([object Object] hard_constraints, seg[object Object] )[object Object] self.__msgc_step9_finish_perform_gc_and_reshape(nlinks, unariesalt2, msinds) |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}func_name and whole_func_string| func_name | whole_func_string | |
|---|---|---|
| type | string | string |
| details |
|
|
| func_name | whole_func_string |
|---|---|
learn | def learn(env,[object Object] network,[object Object] seed=None,[object Object] lr=5e-4,[object Object] total_timesteps=100000,[object Object] buffer_size=50000,[object Object] exploration_fraction=0.1,[object Object] exploration_final_eps=0.02,[object Object] train_freq=1,[object Object] batch_size=32,[object Object] print_freq=100,[object Object] checkpoint_freq=10000,[object Object] checkpoint_path=None,[object Object] learning_starts=1000,[object Object] gamma=1.0,[object Object] target_network_update_freq=500,[object Object] prioritized_replay=False,[object Object] prioritized_replay_alpha=0.6,[object Object] prioritized_replay_beta0=0.4,[object Object] prioritized_replay_beta_iters=None,[object Object] prioritized_replay_eps=1e-6,[object Object] param_noise=False,[object Object] callback=None,[object Object] load_path=None,[object Object] **network_kwargs[object Object] ):[object Object] """Train a deepq model.[object Object][object Object] Parameters[object Object] -------[object Object] env: gym.Env[object Object] environment to train on[object Object] network: string or a function[object Object] 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[object Object] (mlp, cnn, conv_only). If a function, should take an observation tensor and return a latent variable tensor, which[object Object] will be mapped to the Q function heads (see build_q_func in baselines.deepq.models for details on that)[object Object] seed: int or None[object Object] prng seed. The runs with the same seed "should" give the same results. If None, no seeding is used.[object Object] lr: float[object Object] learning rate for adam optimizer[object Object] total_timesteps: int[object Object] number of env steps to optimizer for[object Object] buffer_size: int[object Object] size of the replay buffer[object Object] exploration_fraction: float[object Object] fraction of entire training period over which the exploration rate is annealed[object Object] exploration_final_eps: float[object Object] final value of random action probability[object Object] train_freq: int[object Object] update the model every [object Object] steps.[object Object] set to None to disable printing[object Object] batch_size: int[object Object] size of a batched sampled from replay buffer for training[object Object] print_freq: int[object Object] how often to print out training progress[object Object] set to None to disable printing[object Object] checkpoint_freq: int[object Object] how often to save the model. This is so that the best version is restored[object Object] at the end of the training. If you do not wish to restore the best version at[object Object] the end of the training set this variable to None.[object Object] learning_starts: int[object Object] how many steps of the model to collect transitions for before learning starts[object Object] gamma: float[object Object] discount factor[object Object] target_network_update_freq: int[object Object] update the target network every [object Object] steps.[object Object] prioritized_replay: True[object Object] if True prioritized replay buffer will be used.[object Object] prioritized_replay_alpha: float[object Object] alpha parameter for prioritized replay buffer[object Object] prioritized_replay_beta0: float[object Object] initial value of beta for prioritized replay buffer[object Object] prioritized_replay_beta_iters: int[object Object] number of iterations over which beta will be annealed from initial value[object Object] to 1.0. If set to None equals to total_timesteps.[object Object] prioritized_replay_eps: float[object Object] epsilon to add to the TD errors when updating priorities.[object Object] param_noise: bool[object Object] whether or not to use parameter space noise ([object Object])[object Object] callback: (locals, globals) -> None[object Object] function called at every steps with state of the algorithm.[object Object] If callback returns true training stops.[object Object] load_path: str[object Object] path to load the model from. (default: None)[object Object] **network_kwargs[object Object] additional keyword arguments to pass to the network builder.[object Object][object Object] Returns[object Object] -------[object Object] act: ActWrapper[object Object] Wrapper over act function. Adds ability to save it and load it.[object Object] See header of baselines/deepq/categorical.py for details on the act function.[object Object] """[object Object] # Create all the functions necessary to train the model[object Object][object Object] sess = get_session()[object Object] set_global_seeds(seed)[object Object][object Object] q_func = build_q_func(network, **network_kwargs)[object Object][object Object] # capture the shape outside the closure so that the env object is not serialized[object Object] # by cloudpickle when serializing make_obs_ph[object Object][object Object] observation_space = env.observation_space[object Object] def make_obs_ph(name):[object Object] return ObservationInput(observation_space, name=name)[object Object][object Object] act, train, update_target, debug = deepq.build_train([object Object] make_obs_ph=make_obs_ph,[object Object] q_func=q_func,[object Object] num_actions=env.action_space.n,[object Object] optimizer=tf.train.AdamOptimizer(learning_rate=lr),[object Object] gamma=gamma,[object Object] grad_norm_clipping=10,[object Object] param_noise=param_noise[object Object] )[object Object][object Object] act_params = {[object Object] 'make_obs_ph': make_obs_ph,[object Object] 'q_func': q_func,[object Object] 'num_actions': env.action_space.n,[object Object] }[object Object][object Object] act = ActWrapper(act, act_params)[object Object][object Object] # Create the replay buffer[object Object] if prioritized_replay:[object Object] replay_buffer = PrioritizedReplayBuffer(buffer_size, alpha=prioritized_replay_alpha)[object Object] if prioritized_replay_beta_iters is None:[object Object] prioritized_replay_beta_iters = total_timesteps[object Object] beta_schedule = LinearSchedule(prioritized_replay_beta_iters,[object Object] initial_p=prioritized_replay_beta0,[object Object] final_p=1.0)[object Object] else:[object Object] replay_buffer = ReplayBuffer(buffer_size)[object Object] beta_schedule = None[object Object] # Create the schedule for exploration starting from 1.[object Object] exploration = LinearSchedule(schedule_timesteps=int(exploration_fraction * total_timesteps),[object Object] initial_p=1.0,[object Object] final_p=exploration_final_eps)[object Object][object Object] # Initialize the parameters and copy them to the target network.[object Object] U.initialize()[object Object] update_target()[object Object][object Object] episode_rewards = [0.0][object Object] saved_mean_reward = None[object Object] obs = env.reset()[object Object] reset = True[object Object][object Object] with tempfile.TemporaryDirectory() as td:[object Object] td = checkpoint_path or td[object Object][object Object] model_file = os.path.join(td, "model")[object Object] model_saved = False[object Object][object Object] if tf.train.latest_checkpoint(td) is not None:[object Object] load_variables(model_file)[object Object] logger.log('Loaded model from {}'.format(model_file))[object Object] model_saved = True[object Object] elif load_path is not None:[object Object] load_variables(load_path)[object Object] logger.log('Loaded model from {}'.format(load_path))[object Object][object Object][object Object] for t in range(total_timesteps):[object Object] if callback is not None:[object Object] if callback(locals(), globals()):[object Object] break[object Object] # Take action and update exploration to the newest value[object Object] kwargs = {}[object Object] if not param_noise:[object Object] update_eps = exploration.value(t)[object Object] update_param_noise_threshold = 0.[object Object] else:[object Object] update_eps = 0.[object Object] # Compute the threshold such that the KL divergence between perturbed and non-perturbed[object Object] # policy is comparable to eps-greedy exploration with eps = exploration.value(t).[object Object] # See Appendix C.1 in Parameter Space Noise for Exploration, Plappert et al., 2017[object Object] # for detailed explanation.[object Object] update_param_noise_threshold = -np.log(1. - exploration.value(t) + exploration.value(t) / float(env.action_space.n))[object Object] kwargs['reset'] = reset[object Object] kwargs['update_param_noise_threshold'] = update_param_noise_threshold[object Object] kwargs['update_param_noise_scale'] = True[object Object] action = act(np.array(obs)[None], update_eps=update_eps, **kwargs)[0][object Object] env_action = action[object Object] reset = False[object Object] new_obs, rew, done, _ = env.step(env_action)[object Object] # Store transition in the replay buffer.[object Object] replay_buffer.add(obs, action, rew, new_obs, float(done))[object Object] obs = new_obs[object Object][object Object] episode_rewards[-1] += rew[object Object] if done:[object Object] obs = env.reset()[object Object] episode_rewards.append(0.0)[object Object] reset = True[object Object][object Object] if t > learning_starts and t % train_freq == 0:[object Object] # Minimize the error in Bellman's equation on a batch sampled from replay buffer.[object Object] if prioritized_replay:[object Object] experience = replay_buffer.sample(batch_size, beta=beta_schedule.value(t))[object Object] (obses_t, actions, rewards, obses_tp1, dones, weights, batch_idxes) = experience[object Object] else:[object Object] obses_t, actions, rewards, obses_tp1, dones = replay_buffer.sample(batch_size)[object Object] weights, batch_idxes = np.ones_like(rewards), None[object Object] td_errors = train(obses_t, actions, rewards, obses_tp1, dones, weights)[object Object] if prioritized_replay:[object Object] new_priorities = np.abs(td_errors) + prioritized_replay_eps[object Object] replay_buffer.update_priorities(batch_idxes, new_priorities)[object Object][object Object] if t > learning_starts and t % target_network_update_freq == 0:[object Object] # Update target network periodically.[object Object] update_target()[object Object][object Object] mean_100ep_reward = round(np.mean(episode_rewards[-101:-1]), 1)[object Object] num_episodes = len(episode_rewards)[object Object] if done and print_freq is not None and len(episode_rewards) % print_freq == 0:[object Object] logger.record_tabular("steps", t)[object Object] logger.record_tabular("episodes", num_episodes)[object Object] logger.record_tabular("mean 100 episode reward", mean_100ep_reward)[object Object] logger.record_tabular("% time spent exploring", int(100 * exploration.value(t)))[object Object] logger.dump_tabular()[object Object][object Object] if (checkpoint_freq is not None and t > learning_starts and[object Object] num_episodes > 100 and t % checkpoint_freq == 0):[object Object] if saved_mean_reward is None or mean_100ep_reward > saved_mean_reward:[object Object] if print_freq is not None:[object Object] logger.log("Saving model due to mean reward increase: {} -> {}".format([object Object] saved_mean_reward, mean_100ep_reward))[object Object] save_variables(model_file)[object Object] model_saved = True[object Object] saved_mean_reward = mean_100ep_reward[object Object] if model_saved:[object Object] if print_freq is not None:[object Object] logger.log("Restored model with mean reward: {}".format(saved_mean_reward))[object Object] load_variables(model_file)[object Object][object Object] return act |
ActWrapper.save_act | def save_act(self, path=None):[object Object] """Save model to a pickle located at [object Object]"""[object Object] if path is None:[object Object] path = os.path.join(logger.get_dir(), "model.pkl")[object Object][object Object] with tempfile.TemporaryDirectory() as td:[object Object] save_variables(os.path.join(td, "model"))[object Object] arc_name = os.path.join(td, "packed.zip")[object Object] with zipfile.ZipFile(arc_name, 'w') as zipf:[object Object] for root, dirs, files in os.walk(td):[object Object] for fname in files:[object Object] file_path = os.path.join(root, fname)[object Object] if file_path != arc_name:[object Object] zipf.write(file_path, os.path.relpath(file_path, td))[object Object] with open(arc_name, "rb") as f:[object Object] model_data = f.read()[object Object] with open(path, "wb") as f:[object Object] cloudpickle.dump((model_data, self._act_params), f) |
nature_cnn | def nature_cnn(unscaled_images, **conv_kwargs):[object Object] """[object Object] CNN from Nature paper.[object Object] """[object Object] scaled_images = tf.cast(unscaled_images, tf.float32) / 255.[object Object] activ = tf.nn.relu[object Object] h = activ(conv(scaled_images, 'c1', nf=32, rf=8, stride=4, init_scale=np.sqrt(2),[object Object] **conv_kwargs))[object Object] h2 = activ(conv(h, 'c2', nf=64, rf=4, stride=2, init_scale=np.sqrt(2), **conv_kwargs))[object Object] h3 = activ(conv(h2, 'c3', nf=64, rf=3, stride=1, init_scale=np.sqrt(2), **conv_kwargs))[object Object] h3 = conv_to_fc(h3)[object Object] return activ(fc(h3, 'fc1', nh=512, init_scale=np.sqrt(2))) |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 16learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Truefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Falsehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseeval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falsebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | loss | sts-dev_spearman_cosine |
|---|---|---|---|---|
| 0 | 0 | - | - | 0.8810 |
| 0.08 | 100 | 0.4124 | 0.2191 | - |
| 0.16 | 200 | 0.108 | 0.0993 | - |
| 0.24 | 300 | 0.127 | 0.0756 | - |
| 0.32 | 400 | 0.0728 | - | - |
| 0.08 | 100 | 0.0662 | 0.0683 | - |
| 0.16 | 200 | 0.0321 | 0.0660 | - |
| 0.24 | 300 | 0.0815 | 0.0584 | - |
| 0.32 | 400 | 0.049 | 0.0591 | - |
| 0.4 | 500 | 0.0636 | 0.0612 | - |
| 0.48 | 600 | 0.0929 | 0.0577 | - |
| 0.56 | 700 | 0.0342 | 0.0568 | - |
| 0.64 | 800 | 0.0265 | 0.0572 | - |
| 0.72 | 900 | 0.0406 | 0.0551 | - |
| 0.8 | 1000 | 0.039 | 0.0549 | - |
| 0.88 | 1100 | 0.0376 | 0.0551 | - |
| 0.96 | 1200 | 0.0823 | 0.0556 | - |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 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},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}