RLPack
 
Loading...
Searching...
No Matches
rlpack.utils.internal_code_setup.InternalCodeSetup Class Reference
+ Inheritance diagram for rlpack.utils.internal_code_setup.InternalCodeSetup:
+ Collaboration diagram for rlpack.utils.internal_code_setup.InternalCodeSetup:

Public Member Functions

def __init__ (self)
 
None check_validity_of_apply_norm_code (self, int apply_norm)
 Check of validity of the apply_norm code. More...
 
None check_validity_of_apply_norm_to_code (self, int apply_norm_to)
 Check of validity of the apply_norm_to code. More...
 
int get_apply_norm_mode_code (self, str apply_norm)
 This method retrieves the apply_norm code from the given string. More...
 
int get_apply_norm_to_mode_code (self, List[str] apply_norm_to)
 This method retrieves the apply_norm code_to from the given string. More...
 
int get_prioritization_code (self, str prioritization_strategy)
 This method retrieves the prioritization code for corresponding strategy passed as string in prioritized parameters. More...
 
def __init__ (self)
 

Additional Inherited Members

- Data Fields inherited from rlpack.utils.base.internal_code_register.InternalCodeRegister
 norm_mode_codes
 The mapping between given keyword and normalisation method codes. More...
 
 norm_to_mode_codes
 The mapping between given keyword and normalisation quantity (apply_norm_to) codes. More...
 
 prioritization_strategy_codes
 The mapping between prioritization strategy keywords and prioritization strategy codes. More...
 

Constructor & Destructor Documentation

◆ __init__()

def rlpack.utils.internal_code_setup.InternalCodeSetup.__init__ (   self)

Member Function Documentation

◆ check_validity_of_apply_norm_code()

None rlpack.utils.internal_code_setup.InternalCodeSetup.check_validity_of_apply_norm_code (   self,
int  apply_norm 
)

Check of validity of the apply_norm code.

Raises ValueError if code is invalid.

Parameters
apply_normint: apply_norm code to check

◆ check_validity_of_apply_norm_to_code()

None rlpack.utils.internal_code_setup.InternalCodeSetup.check_validity_of_apply_norm_to_code (   self,
int  apply_norm_to 
)

Check of validity of the apply_norm_to code.

Raises ValueError if code is invalid.

Parameters
apply_norm_toint: apply_norm_to code to check

◆ get_apply_norm_mode_code()

int rlpack.utils.internal_code_setup.InternalCodeSetup.get_apply_norm_mode_code (   self,
str  apply_norm 
)

This method retrieves the apply_norm code from the given string.

This code is to be supplied to agents.

Parameters
apply_normstr: The apply_norm string, specifying the normalization techniques to be used. *See the notes below to see the accepted values.
Returns
(int): The code corresponding to the supplied valid apply_norm.
  • NOTE The value accepted for apply_norm are:
    • "none": No normalization
    • "min_max": Min-Max normalization
    • "standardize": Standardization.
    • "p_norm": P-Normalization

◆ get_apply_norm_to_mode_code()

int rlpack.utils.internal_code_setup.InternalCodeSetup.get_apply_norm_to_mode_code (   self,
List[str]  apply_norm_to 
)

This method retrieves the apply_norm code_to from the given string.

This code is to be supplied to agents.

Parameters
apply_norm_toList[str]: The apply_norm_to list, specifying the quantities on which we wish to apply normalization specified by apply_norm *See the notes below to see the accepted values.
Returns
int: The code corresponding to the supplied valid apply_norm_to.

*NOTE The value accepted for apply_norm_to are:

  • ["none"]: Don't apply normalization to any quantity.
  • ["states"]: Apply normalization to states.
  • ["rewards"]: Apply normalization to rewards.
  • ["td"]: Apply normalization for TD values.
  • ["states", "rewards"]: Apply normalization to states and rewards.
  • ["states", "td"]: Apply normalization to states and TD values.

◆ get_prioritization_code()

int rlpack.utils.internal_code_setup.InternalCodeSetup.get_prioritization_code (   self,
str  prioritization_strategy 
)

This method retrieves the prioritization code for corresponding strategy passed as string in prioritized parameters.

Parameters
prioritization_strategystr: A dictionary containing memory prioritization parameters for agents that may use it *See the notes below to see the accepted values.
Returns
int: The prioritization code for corresponding string value.

*NOTE: The accepted values for prioritization_strategy are as follows:

  • "uniform": No prioritization is done, i.e., uniform sampling takes place; Code: 0.
  • "proportional": Proportional prioritization takes place when sampling transition; Code: 1.
  • "rank-based": Rank based prioritization takes place when sampling transitions; Code: 2.