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
Method
compute
( self, prompt_texts: List[str], generated_texts: List[str], reference_texts:
rl4lms/envs/text_generation/metric.py:491
Method
compute
( self, prompt_texts: List[str], generated_texts: List[str], reference_texts:
rl4lms/envs/text_generation/metric.py:575
Method
compute
( self, prompt_texts: List[str], generated_texts: List[str], reference_texts:
rl4lms/envs/text_generation/metric.py:599
Method
compute
( self, prompt_texts: List[str], generated_texts: List[str], reference_texts:
rl4lms/envs/text_generation/metric.py:622
Method
compute
( self, prompt_texts: List[str], generated_texts: List[str], reference_texts:
rl4lms/envs/text_generation/metric.py:645
Method
compute
( self, prompt_texts: List[str], generated_texts: List[str], reference_texts:
rl4lms/envs/text_generation/metric.py:676
Method
compute
(self, prompt_texts: List[str], generated_texts: List[str], reference_texts: L
rl4lms/envs/text_generation/test_metric.py:16
Method
compute
(self, prompt_texts: List[str], generated_texts: List[str], reference_texts: L
rl4lms/envs/text_generation/test_metric.py:36
Function
compute_metrics
(eval_preds)
scripts/reward-modeling/train_intent_classifier.py:63
Method
counts2vec
Function maps counts of ngram to vector of tfidf weights. The function returns vec, an array of dictionary that store mapping
rl4lms/envs/text_generation/caption_metrics/cider.py:116
Method
entropy
(self)
rl4lms/algorithms/common/maskable/distributions.py:146
Method
entropy
(self)
rl4lms/algorithms/common/maskable/distributions.py:219
Method
evaluate_actions
(self, obs: torch.Tensor, actions: torch.Tensor)
rl4lms/envs/text_generation/policy.py:212
Method
evaluate_actions
(self, obs: torch.Tensor, actions: torch.Tensor, action_mask
rl4lms/envs/text_generation/policy.py:757
Method
evaluate_actions
Evaluates specified <observation, action> and returns log_probs, values, entropy This is invoked for each mini-batch in roll
rl4lms/envs/text_generation/policy/base_policy.py:317
Method
evaluate_actions
( self, obs: torch.Tensor, actions: torch.Tensor )
rl4lms/envs/text_generation/policy/causal_policy.py:208
Method
evaluate_actions
( self, obs: torch.Tensor, actions: torch.Tensor, action_masks: torch.Tensor )
rl4lms/envs/text_generation/policy/causal_policy.py:477
Method
evaluate_actions
( self, obs: torch.Tensor, actions: torch.Tensor )
rl4lms/envs/text_generation/policy/seq2seq_policy.py:238
Method
evaluate_actions
( self, obs: torch.Tensor, actions: torch.Tensor, action_masks: torch.Tensor )
rl4lms/envs/text_generation/policy/seq2seq_policy.py:495
Method
featurize
(self, observation: BaseObservation)
rl4lms/envs/common/observation.py:17
Method
forward
(self, *args, **kwargs)
rl4lms/envs/text_generation/policy.py:747
Method
forward
Forward pass in all the networks (actor and critic) :param obs: Observation :param deterministic: Whether to sample or use d
rl4lms/algorithms/common/maskable/policies.py:95
Method
forward_policy
(self, obs: TensorDict, actions: torch.tensor, model_kwargs: Opt
rl4lms/envs/text_generation/policy.py:389
Method
forward_policy
(self, obs: TensorDict, actions: torch.Tensor, action_masks: tor
rl4lms/envs/text_generation/policy.py:991
Method
forward_policy
Performs a forward pass on the policy and gets log_probs, entropy etc corresponding to specified observation, actions This i
rl4lms/envs/text_generation/policy/base_policy.py:278
Method
forward_value
(self, obs: TensorDict, model_kwargs: Optional[Dict[str, torch.tensor]] = None)
rl4lms/envs/text_generation/policy.py:439
Method
forward_value
(self, obs: TensorDict, model_kwargs: Optional[Dict[str, torch.tensor]] = None)
rl4lms/envs/text_generation/policy.py:1048
Method
forward_value
Performs a forward pass on the value network and gets values corresponding to observations This is invoked during rollout generation
rl4lms/envs/text_generation/policy/base_policy.py:299
Method
gen_split_name
(split: str)
rl4lms/data_pools/custom_text_generation_pools.py:146
Method
generate
r""" Generates sequences of token ids for models with a language modeling head. The method supports the following generation methods
rl4lms/envs/text_generation/hf_generation_utils.py:867
Method
generate
(self, tokenizer: AutoTokenizer, texts: List[str] = None, max_prompt_length:
rl4lms/envs/text_generation/policy.py:809
Method
generate
( self, tokenizer: AutoTokenizer, texts: List[str] = None, max_prompt_length:
rl4lms/envs/text_generation/policy/base_policy.py:178
Method
generate
( self, tokenizer: AutoTokenizer, texts: List[str] = None, max_prompt_length:
rl4lms/envs/text_generation/policy/causal_policy.py:493
Method
generate
( self, tokenizer: AutoTokenizer, texts: List[str] = None, max_prompt_length:
rl4lms/envs/text_generation/policy/seq2seq_policy.py:536
Method
get
(cls, datapool_id: str, kwargs: Dict[str, Any])
rl4lms/envs/text_generation/registry.py:105
Method
get
(cls, reward_fn_id: str, kwargs: Dict[str, Any])
rl4lms/envs/text_generation/registry.py:139
Method
get
(cls, policy_id: str)
rl4lms/envs/text_generation/registry.py:194
Method
get
( cls, alg_id: str )
rl4lms/envs/text_generation/registry.py:212
Method
get
(cls, alg_id: str)
rl4lms/envs/text_generation/registry.py:237
Method
get
(cls, post_processor_id: str)
rl4lms/envs/text_generation/registry.py:255
Method
get
(self, batch_size: Optional[int] = None)
rl4lms/algorithms/common/maskable/buffers.py:188
Method
get_action_space
Lists all possible actions indices and its meaning Returns: ActionSpace -- an instance of action space
rl4lms/envs/common/base_env.py:66
Method
get_all_samples
(self)
rl4lms/core_components/sampler.py:39
Method
get_config_module
(self)
rl4lms/envs/text_generation/policy.py:353
Method
get_config_module
(self)
rl4lms/envs/text_generation/policy.py:543
Method
get_config_module
(self)
rl4lms/envs/text_generation/policy.py:915
Method
get_config_module
(self)
rl4lms/envs/text_generation/policy.py:1152
Method
get_dataset
(cls, split: str)
rl4lms/data_pools/custom_text_generation_pools.py:383
Method
get_dataset
(cls, split: str)
rl4lms/data_pools/custom_text_generation_pools.py:414
Method
get_dataset
(cls, split: str)
rl4lms/data_pools/custom_text_generation_pools.py:450
Method
get_distribution
(self, obs: TensorDict, detach=False)
rl4lms/envs/text_generation/policy.py:99
Method
get_distribution
(self, obs: TensorDict, detach=False)
rl4lms/envs/text_generation/policy/causal_policy.py:281
Function
get_highlighted_subtable
Extract out the highlighted part of a table.
rl4lms/data_pools/task_utils/totto/preprocess_utils.py:64
Function
get_highlighted_subtable
Extract out the highlighted part of a table.
rl4lms/data_pools/task_utils/totto/eval_utils/table_to_text_utils.py:18
Method
get_input_for_classifier
(prompt, generated_text)
rl4lms/envs/text_generation/metric.py:685
Method
get_inputs_for_generation
(self, obs: TensorDict)
rl4lms/envs/text_generation/policy.py:540
Method
get_inputs_for_generation
(self, obs: TensorDict)
rl4lms/envs/text_generation/policy.py:806
Method
get_inputs_for_generation
(self, obs: TensorDict)
rl4lms/envs/text_generation/policy.py:1149
Method
get_inputs_for_generation
Extracts the prompt inputs and attention masks which is used as seed for generation
rl4lms/envs/text_generation/policy/base_policy.py:363
Method
get_inputs_for_generation
(self, obs: TensorDict)
rl4lms/envs/text_generation/policy/causal_policy.py:265
Method
get_inputs_for_generation
(self, obs: TensorDict)
rl4lms/envs/text_generation/policy/seq2seq_policy.py:334
Method
get_language_model
(self)
rl4lms/envs/text_generation/policy.py:909
Method
get_language_model
(self)
rl4lms/envs/text_generation/policy/base_policy.py:265
Method
get_log_probs_ref_model
(self, obs: TensorDict, action: torch.tensor,
rl4lms/envs/text_generation/policy.py:488
Method
get_log_probs_ref_model
(self, obs: TensorDict, action: torch.tensor,
rl4lms/envs/text_generation/policy.py:768
Method
get_log_probs_ref_model
(self, obs: TensorDict, action: torch.tensor,
rl4lms/envs/text_generation/policy.py:1097
Method
get_log_probs_ref_model
Performs a forward pass on the reference policy and gets log_probs corresponding to specified observation, actions This is i
rl4lms/envs/text_generation/policy/base_policy.py:329
Method
get_log_probs_ref_model
( self, obs: TensorDict, action: torch.tensor, past_model_kwargs: Dict[str, An
rl4lms/envs/text_generation/policy/causal_policy.py:222
Method
get_log_probs_ref_model
( self, obs: TensorDict, action: torch.tensor, model_kwarpast_model_kwargsgs:
rl4lms/envs/text_generation/policy/seq2seq_policy.py:259
Method
get_observation_dim
Returns the observation dim
rl4lms/envs/common/observation.py:20
Method
get_policy_first_device
(self)
rl4lms/envs/text_generation/policy.py:537
Method
get_policy_first_device
(self)
rl4lms/envs/text_generation/policy.py:1146
Method
get_policy_type
(self)
rl4lms/envs/text_generation/policy.py:356
Method
get_policy_type
(self)
rl4lms/envs/text_generation/policy.py:546
Method
get_policy_type
(self)
rl4lms/envs/text_generation/policy.py:918
Method
get_policy_type
(self)
rl4lms/envs/text_generation/policy.py:1155
Method
get_policy_type
Returns the type of policy (causal or seq2seq)
rl4lms/envs/text_generation/policy/base_policy.py:356
Method
get_policy_type
(self)
rl4lms/envs/text_generation/policy/causal_policy.py:271
Method
get_policy_type
(self)
rl4lms/envs/text_generation/policy/seq2seq_policy.py:341
Method
get_samples
Returns list of samples available in the environment Returns: List[Sample]: list of samples in the environment
rl4lms/envs/common/base_env.py:84
Method
get_state_dict
(self)
rl4lms/envs/text_generation/warm_start.py:13
Method
get_state_dict
(self)
rl4lms/envs/text_generation/warm_start.py:27
Method
get_state_dict
(self)
rl4lms/envs/text_generation/warm_start.py:45
Method
get_state_dict
(self)
rl4lms/envs/text_generation/warm_start.py:79
Function
get_subtable_parent_format
Convert subtable to PARENT format. Do not include section text.
rl4lms/data_pools/task_utils/totto/eval_utils/table_to_text_utils.py:68
Function
get_table_parent_format
Convert table to format required by PARENT.
rl4lms/data_pools/task_utils/totto/eval_utils/table_to_text_utils.py:28
Method
hessian_vector_product
Computes the matrix-vector product with the Fisher information matrix. :param params: list of parameters used to compute the Hessian
rl4lms/algorithms/trpo/trpo.py:415
Method
ix_to_action
(self, ix: int)
rl4lms/envs/common/action_space.py:19
Method
kl_coeff
(self)
rl4lms/envs/text_generation/kl_controllers.py:20
Method
learn
( self, total_timesteps: int, callback: MaybeCallback = None, log_interval: in
rl4lms/algorithms/nlpo/nlpo.py:454
Method
learn
( self, total_timesteps: int, callback: MaybeCallback = None, log_interval: in
rl4lms/algorithms/ppo/ppo.py:329
Method
learn
( self, total_timesteps: int, callback: MaybeCallback = None, log_interval: in
rl4lms/algorithms/trpo/trpo.py:430
Function
linearize_full_table
Linearize full table with localized headers and return a string.
rl4lms/data_pools/task_utils/totto/preprocess_utils.py:91
Function
linearize_subtable
Linearize the highlighted subtable and return a string of its contents.
rl4lms/data_pools/task_utils/totto/preprocess_utils.py:140
Method
load_from_dict
(self, state_dict: dict = None)
rl4lms/envs/text_generation/warm_start.py:20
Method
load_from_dict
(self, state_dict: dict = None)
rl4lms/envs/text_generation/warm_start.py:36
Method
load_from_dict
(self, state_dict: dict = None)
rl4lms/envs/text_generation/warm_start.py:55
Method
load_from_dict
(self, state_dict: Dict[str, Any])
rl4lms/envs/text_generation/warm_start.py:86
Method
log_prob_from_params
(self, action_logits: th.Tensor)
rl4lms/algorithms/common/maskable/distributions.py:163
Method
log_prob_from_params
(self, action_logits: th.Tensor)
rl4lms/algorithms/common/maskable/distributions.py:236
← previous
next →
401–500 of 555, ranked by callers