MCPcopy Create free account

hub / github.com/allenai/RL4LMs / functions

Functions555 in github.com/allenai/RL4LMs

↓ 1 callersFunctionfind_products
(splits_by_keys: Dict)
rl4lms/core_components/sweep.py:14
↓ 1 callersFunctionflat_grad
Returns the gradients of the passed sequence of parameters into a flat gradient. Order of parameters is preserved. :param output: functi
rl4lms/algorithms/common/algo_utils.py:139
↓ 1 callersMethodforward
(self, originals, generateds, images=None)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:296
↓ 1 callersMethodforward_policy
(self, obs: TensorDict, actions: torch.Tensor, action_masks: tor
rl4lms/envs/text_generation/policy.py:673
↓ 1 callersMethodforward_policy
( self, obs: TensorDict, actions: torch.tensor, past_model_kwargs: Optional[Di
rl4lms/envs/text_generation/policy/causal_policy.py:116
↓ 1 callersMethodforward_policy
( self, obs: TensorDict, actions: torch.Tensor, action_masks: torch.Tensor = N
rl4lms/envs/text_generation/policy/causal_policy.py:419
↓ 1 callersMethodforward_policy
( self, obs: TensorDict, actions: torch.tensor, past_model_kwargs: Optional[Di
rl4lms/envs/text_generation/policy/seq2seq_policy.py:94
↓ 1 callersMethodforward_policy
( self, obs: TensorDict, actions: torch.Tensor, action_masks: torch.Tensor = N
rl4lms/envs/text_generation/policy/seq2seq_policy.py:415
↓ 1 callersMethodforward_value
(self, obs: TensorDict, past_model_kwargs: Optional[Dict[str, torch.tensor]] = None)
rl4lms/envs/text_generation/policy.py:717
↓ 1 callersFunctiongenerate
(model: PreTrainedModel, tokenizer: AutoTokenizer, texts: List[str] = None,
rl4lms/envs/text_generation/utils_supervised.py:63
↓ 1 callersMethodgenerate_batch
( self, rollout_buffer: DictRolloutBuffer, tokenizer: PreTrainedTokenizer,
rl4lms/envs/text_generation/alg_wrappers.py:141
↓ 1 callersFunctiongenerate_on_samples
(model: PreTrainedModel, tokenizer: AutoTokenizer, samples: Li
rl4lms/envs/text_generation/utils_supervised.py:256
↓ 1 callersFunctiongenerate_text
(model: PreTrainedModel, tokenizer: AutoTokenizer, samples: List[Sample],
rl4lms/envs/text_generation/utils_supervised.py:48
↓ 1 callersFunctiongenerate_text
( policy: BasePolicy, tokenizer: AutoTokenizer, samples: List[Sample], max_prompt_length: int,
rl4lms/envs/text_generation/evaluation_utils.py:100
↓ 1 callersFunctionget_action_masks
Checks whether gym env exposes a method returning invalid action masks :param env: the Gym environment to get masks from :return: A nump
rl4lms/algorithms/common/maskable/utils.py:8
↓ 1 callersFunctionget_batch
(samples, batch_size: int)
scripts/reward-modeling/evaluate_intent_classifier.py:11
↓ 1 callersFunctionget_batch
(samples: List[Sample], batch_size: int)
rl4lms/envs/text_generation/utils_supervised.py:13
↓ 1 callersFunctionget_batch
(samples: List[Sample], batch_size: int)
rl4lms/envs/text_generation/evaluation_utils.py:12
↓ 1 callersFunctionget_datasets_for_causal
(train_datapool: TextGenPool)
rl4lms/envs/text_generation/utils_supervised.py:150
↓ 1 callersFunctionget_datasets_for_seq2seq
(train_datapool: TextGenPool)
rl4lms/envs/text_generation/utils_supervised.py:166
↓ 1 callersMethodget_device
(self, model: PreTrainedModel)
rl4lms/envs/text_generation/metric.py:429
↓ 1 callersMethodget_inputs_for_generation
(self, obs: TensorDict)
rl4lms/envs/text_generation/policy.py:350
↓ 1 callersMethodget_log_probs_ref_model
(self, obs: TensorDict, action: torch.tensor,
rl4lms/envs/text_generation/policy.py:221
↓ 1 callersFunctionget_model
(model_type, device=None)
rl4lms/envs/text_generation/preference_reward.py:32
↓ 1 callersFunctionget_neutral_idx
(ent_idx, con_idx)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:56
↓ 1 callersFunctionget_parent_tables
Get tables in PARENT format for each json example.
rl4lms/data_pools/task_utils/totto/eval_utils/prepare_references_for_eval.py:57
↓ 1 callersMethodget_policy_kwargs
( self, obs: TensorDict, action: torch.tensor, past_state: Dic
rl4lms/envs/text_generation/alg_wrappers.py:124
↓ 1 callersFunctionget_references
Get references from json example.
rl4lms/data_pools/task_utils/totto/eval_utils/prepare_references_for_eval.py:32
↓ 1 callersMethodget_state_dict
(self)
rl4lms/envs/text_generation/kl_controllers.py:23
↓ 1 callersFunctionget_tokenizer
(model_type)
rl4lms/envs/text_generation/preference_reward.py:76
↓ 1 callersMethodgreedy_search
r""" Generates sequences of token ids for models with a language modeling head using **greedy decoding** and can be used for text-deco
rl4lms/envs/text_generation/hf_generation_utils.py:1544
↓ 1 callersMethodgroup_beam_search
r""" Generates sequences of token ids for models with a language modeling head using **diverse beam search decoding** and can be used
rl4lms/envs/text_generation/hf_generation_utils.py:2736
↓ 1 callersFunctionis_masking_supported
Checks whether gym env exposes a method returning invalid action masks :param env: the Gym environment to check :return: True if the met
rl4lms/algorithms/common/maskable/utils.py:22
↓ 1 callersMethodis_number
(text)
rl4lms/envs/text_generation/test_reward.py:15
↓ 1 callersMethodlearn
( self, total_timesteps: int, callback: MaybeCallback = None, log_interval: in
rl4lms/algorithms/a2c/a2c.py:198
↓ 1 callersMethodload_nli
(self)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:87
↓ 1 callersMethodload_trainer_state
(self, tracker: Tracker)
rl4lms/envs/text_generation/warm_start.py:113
↓ 1 callersMethodlog_prob
(self, actions: th.Tensor)
rl4lms/algorithms/common/maskable/distributions.py:208
↓ 1 callersFunctionmain
( config_path: str, project_name: str, experiment_name: str, base_path_to_store_results: str,
scripts/training/train_text_generation.py:13
↓ 1 callersFunctionmain
()
scripts/reward-modeling/train_intent_classifier.py:36
↓ 1 callersFunctionmake_masked_proba_distribution
Return an instance of Distribution for the correct type of action space :param action_space: the input action space :return: the appropr
rl4lms/algorithms/common/maskable/distributions.py:271
↓ 1 callersFunctionname_to_card
(name)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:50
↓ 1 callersFunctionparent
Metric for comparing predictions to references given tables. Args: predictions: An iterator over tokenized predictions. Each prediction is
rl4lms/data_pools/task_utils/totto/eval_utils/totto_parent_eval.py:292
↓ 1 callersFunctionparse_args
Optional args for main function, mostly just to test.
rl4lms/envs/text_generation/preference_reward.py:155
↓ 1 callersMethodpredict_values
Get the estimated values according to the current policy given the observations. :param obs: :return: the estimated values.
rl4lms/algorithms/common/maskable/policies.py:307
↓ 1 callersMethodprepare
(cls, split: str, prompt: str, n_samples=100)
rl4lms/envs/text_generation/test_datapool.py:6
↓ 1 callersMethodproba_distribution
(self, action_logits: th.Tensor)
rl4lms/algorithms/common/maskable/distributions.py:199
↓ 1 callersMethodproba_distribution_net
Create the layer that represents the distribution: it will be the logits of the Categorical distribution. You can then get pr
rl4lms/algorithms/common/maskable/distributions.py:125
↓ 1 callersMethodrender
Renders the current state of the environment
rl4lms/envs/common/base_env.py:48
↓ 1 callersMethodsample
(self)
rl4lms/algorithms/common/maskable/distributions.py:150
↓ 1 callersMethodsave_trainer_state
(self, tracker: Tracker, policy: LMActorCriticPolicy, tr
rl4lms/envs/text_generation/warm_start.py:143
↓ 1 callersMethodscore_one
(self, original, generated)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:373
↓ 1 callersMethodset_featurizer
Sets the observation featurizer (can also change during run time)
rl4lms/envs/common/base_env.py:93
↓ 1 callersMethodsplit_2sents
(self, text)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:105
↓ 1 callersFunctionsplit_config
Recursively splits the given object
rl4lms/core_components/sweep.py:31
↓ 1 callersFunctionto_expand
(obj: Any)
rl4lms/core_components/sweep.py:25
↓ 1 callersFunctiontokenize_fn
( x)
rl4lms/data_pools/task_utils/totto/eval_utils/totto_parent_eval.py:83
↓ 1 callersMethodtrain
Update policy using the currently gathered rollout buffer.
rl4lms/algorithms/nlpo/nlpo.py:313
↓ 1 callersMethodtrain_and_eval
(self)
rl4lms/envs/text_generation/training_utils.py:194
↓ 1 callersFunctionunpack_observations
Unpacks vectorized dict observations into separate dict observations
rl4lms/envs/text_generation/alg_wrappers.py:43
↓ 1 callersMethodupdate_mask_model
(self)
rl4lms/envs/text_generation/policy.py:912
Method__call__
(self, prev_observation: Observation, action: int, current_observation: Obse
rl4lms/envs/text_generation/test_reward.py:41
Method__call__
(self, prev_observation: Observation, action: int, current_observation: Obse
rl4lms/envs/text_generation/test_reward.py:64
Method__call__
Callable for reward functions for text generation Args: current_observation (Observation): previous observation (s)
rl4lms/envs/text_generation/reward.py:25
Method__call__
An abstract class for batched reward functions for text generation
rl4lms/envs/text_generation/reward.py:54
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:72
Method__call__
( self, prompt_texts: List[str], gen_texts: List[str], ref_texts: List[List[st
rl4lms/envs/text_generation/reward.py:99
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:138
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:179
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:220
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:256
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:278
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:301
Method__call__
( self, prompt_texts: List[str], gen_texts: List[str], ref_texts: List[List[st
rl4lms/envs/text_generation/reward.py:332
Method__call__
( self, prompt_texts: List[str], gen_texts: List[str], ref_texts: List[List[st
rl4lms/envs/text_generation/reward.py:391
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:456
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:491
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:519
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:541
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:564
Method__call__
( self, current_observation: Observation, action: int, next_observation: Obser
rl4lms/envs/text_generation/reward.py:589
Method__call__
( self, prompt_texts: List[str], gen_texts: List[str], ref_texts: List[List[st
rl4lms/envs/text_generation/reward.py:619
Method__call__
( self, prompt_texts: List[str], gen_texts: List[str], ref_texts: List[List[st
rl4lms/envs/text_generation/preference_reward.py:218
Method__call__
[summary] Args: observation (Observation): current observation at t action (str): current action at t tar
rl4lms/envs/common/reward.py:9
Method__call__
( self, input_ids: torch.LongTensor, scores: torch.FloatTensor, model_inputs:
rl4lms/algorithms/common/maskable/logits_processor.py:144
Method__call__
( self, input_ids: torch.LongTensor, scores: torch.FloatTensor, model_inputs:
rl4lms/algorithms/common/maskable/logits_processor.py:290
Method__getitem__
(self, idx)
rl4lms/envs/text_generation/preference_reward.py:95
Method__getitem__
(self, ix: int)
rl4lms/data_pools/text_generation_pool.py:22
Method__iadd__
add an instance (e.g., from another sentence).
rl4lms/envs/text_generation/caption_metrics/cider.py:90
Method__init__
Creates a priority sampler Args: max_size (int): maximum size of the queue priority_scale (float): 0.0 is a
rl4lms/core_components/sampler.py:7
Method__init__
( self, model_name: str, label_ix: int, batch_size: int, include_promp
rl4lms/envs/text_generation/metric.py:45
Method__init__
(self)
rl4lms/envs/text_generation/metric.py:108
Method__init__
(self, use_single_ref: bool = True)
rl4lms/envs/text_generation/metric.py:131
Method__init__
(self, language: str)
rl4lms/envs/text_generation/metric.py:164
Method__init__
(self)
rl4lms/envs/text_generation/metric.py:194
Method__init__
(self, config_name: str = None)
rl4lms/envs/text_generation/metric.py:228
Method__init__
(self)
rl4lms/envs/text_generation/metric.py:277
Method__init__
(self)
rl4lms/envs/text_generation/metric.py:305
Method__init__
(self, window_size: int = 100)
rl4lms/envs/text_generation/metric.py:334
Method__init__
(self, **kwargs)
rl4lms/envs/text_generation/metric.py:368
← previousnext →201–300 of 555, ranked by callers