Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/allenai/RL4LMs
/ functions
Functions
555 in github.com/allenai/RL4LMs
⨍
Functions
555
◇
Types & classes
140
↓ 1 callers
Function
find_products
(splits_by_keys: Dict)
rl4lms/core_components/sweep.py:14
↓ 1 callers
Function
flat_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 callers
Method
forward
(self, originals, generateds, images=None)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:296
↓ 1 callers
Method
forward_policy
(self, obs: TensorDict, actions: torch.Tensor, action_masks: tor
rl4lms/envs/text_generation/policy.py:673
↓ 1 callers
Method
forward_policy
( self, obs: TensorDict, actions: torch.tensor, past_model_kwargs: Optional[Di
rl4lms/envs/text_generation/policy/causal_policy.py:116
↓ 1 callers
Method
forward_policy
( self, obs: TensorDict, actions: torch.Tensor, action_masks: torch.Tensor = N
rl4lms/envs/text_generation/policy/causal_policy.py:419
↓ 1 callers
Method
forward_policy
( self, obs: TensorDict, actions: torch.tensor, past_model_kwargs: Optional[Di
rl4lms/envs/text_generation/policy/seq2seq_policy.py:94
↓ 1 callers
Method
forward_policy
( self, obs: TensorDict, actions: torch.Tensor, action_masks: torch.Tensor = N
rl4lms/envs/text_generation/policy/seq2seq_policy.py:415
↓ 1 callers
Method
forward_value
(self, obs: TensorDict, past_model_kwargs: Optional[Dict[str, torch.tensor]] = None)
rl4lms/envs/text_generation/policy.py:717
↓ 1 callers
Function
generate
(model: PreTrainedModel, tokenizer: AutoTokenizer, texts: List[str] = None,
rl4lms/envs/text_generation/utils_supervised.py:63
↓ 1 callers
Method
generate_batch
( self, rollout_buffer: DictRolloutBuffer, tokenizer: PreTrainedTokenizer,
rl4lms/envs/text_generation/alg_wrappers.py:141
↓ 1 callers
Function
generate_on_samples
(model: PreTrainedModel, tokenizer: AutoTokenizer, samples: Li
rl4lms/envs/text_generation/utils_supervised.py:256
↓ 1 callers
Function
generate_text
(model: PreTrainedModel, tokenizer: AutoTokenizer, samples: List[Sample],
rl4lms/envs/text_generation/utils_supervised.py:48
↓ 1 callers
Function
generate_text
( policy: BasePolicy, tokenizer: AutoTokenizer, samples: List[Sample], max_prompt_length: int,
rl4lms/envs/text_generation/evaluation_utils.py:100
↓ 1 callers
Function
get_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 callers
Function
get_batch
(samples, batch_size: int)
scripts/reward-modeling/evaluate_intent_classifier.py:11
↓ 1 callers
Function
get_batch
(samples: List[Sample], batch_size: int)
rl4lms/envs/text_generation/utils_supervised.py:13
↓ 1 callers
Function
get_batch
(samples: List[Sample], batch_size: int)
rl4lms/envs/text_generation/evaluation_utils.py:12
↓ 1 callers
Function
get_datasets_for_causal
(train_datapool: TextGenPool)
rl4lms/envs/text_generation/utils_supervised.py:150
↓ 1 callers
Function
get_datasets_for_seq2seq
(train_datapool: TextGenPool)
rl4lms/envs/text_generation/utils_supervised.py:166
↓ 1 callers
Method
get_device
(self, model: PreTrainedModel)
rl4lms/envs/text_generation/metric.py:429
↓ 1 callers
Method
get_inputs_for_generation
(self, obs: TensorDict)
rl4lms/envs/text_generation/policy.py:350
↓ 1 callers
Method
get_log_probs_ref_model
(self, obs: TensorDict, action: torch.tensor,
rl4lms/envs/text_generation/policy.py:221
↓ 1 callers
Function
get_model
(model_type, device=None)
rl4lms/envs/text_generation/preference_reward.py:32
↓ 1 callers
Function
get_neutral_idx
(ent_idx, con_idx)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:56
↓ 1 callers
Function
get_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 callers
Method
get_policy_kwargs
( self, obs: TensorDict, action: torch.tensor, past_state: Dic
rl4lms/envs/text_generation/alg_wrappers.py:124
↓ 1 callers
Function
get_references
Get references from json example.
rl4lms/data_pools/task_utils/totto/eval_utils/prepare_references_for_eval.py:32
↓ 1 callers
Method
get_state_dict
(self)
rl4lms/envs/text_generation/kl_controllers.py:23
↓ 1 callers
Function
get_tokenizer
(model_type)
rl4lms/envs/text_generation/preference_reward.py:76
↓ 1 callers
Method
greedy_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 callers
Method
group_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 callers
Function
is_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 callers
Method
is_number
(text)
rl4lms/envs/text_generation/test_reward.py:15
↓ 1 callers
Method
learn
( self, total_timesteps: int, callback: MaybeCallback = None, log_interval: in
rl4lms/algorithms/a2c/a2c.py:198
↓ 1 callers
Method
load_nli
(self)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:87
↓ 1 callers
Method
load_trainer_state
(self, tracker: Tracker)
rl4lms/envs/text_generation/warm_start.py:113
↓ 1 callers
Method
log_prob
(self, actions: th.Tensor)
rl4lms/algorithms/common/maskable/distributions.py:208
↓ 1 callers
Function
main
( config_path: str, project_name: str, experiment_name: str, base_path_to_store_results: str,
scripts/training/train_text_generation.py:13
↓ 1 callers
Function
main
()
scripts/reward-modeling/train_intent_classifier.py:36
↓ 1 callers
Function
make_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 callers
Function
name_to_card
(name)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:50
↓ 1 callers
Function
parent
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 callers
Function
parse_args
Optional args for main function, mostly just to test.
rl4lms/envs/text_generation/preference_reward.py:155
↓ 1 callers
Method
predict_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 callers
Method
prepare
(cls, split: str, prompt: str, n_samples=100)
rl4lms/envs/text_generation/test_datapool.py:6
↓ 1 callers
Method
proba_distribution
(self, action_logits: th.Tensor)
rl4lms/algorithms/common/maskable/distributions.py:199
↓ 1 callers
Method
proba_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 callers
Method
render
Renders the current state of the environment
rl4lms/envs/common/base_env.py:48
↓ 1 callers
Method
sample
(self)
rl4lms/algorithms/common/maskable/distributions.py:150
↓ 1 callers
Method
save_trainer_state
(self, tracker: Tracker, policy: LMActorCriticPolicy, tr
rl4lms/envs/text_generation/warm_start.py:143
↓ 1 callers
Method
score_one
(self, original, generated)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:373
↓ 1 callers
Method
set_featurizer
Sets the observation featurizer (can also change during run time)
rl4lms/envs/common/base_env.py:93
↓ 1 callers
Method
split_2sents
(self, text)
rl4lms/envs/text_generation/summ_metrics/summa_c.py:105
↓ 1 callers
Function
split_config
Recursively splits the given object
rl4lms/core_components/sweep.py:31
↓ 1 callers
Function
to_expand
(obj: Any)
rl4lms/core_components/sweep.py:25
↓ 1 callers
Function
tokenize_fn
( x)
rl4lms/data_pools/task_utils/totto/eval_utils/totto_parent_eval.py:83
↓ 1 callers
Method
train
Update policy using the currently gathered rollout buffer.
rl4lms/algorithms/nlpo/nlpo.py:313
↓ 1 callers
Method
train_and_eval
(self)
rl4lms/envs/text_generation/training_utils.py:194
↓ 1 callers
Function
unpack_observations
Unpacks vectorized dict observations into separate dict observations
rl4lms/envs/text_generation/alg_wrappers.py:43
↓ 1 callers
Method
update_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
← previous
next →
201–300 of 555, ranked by callers