rl-js configuration
Configuration utilities for rl-js: Reinforcement Learning in JavaScript.
istallation
npm install --save @rl-js/configuration
JSDOC
Classes
- AgentBuilder
- AgentSuite
- EnvironmentBuilder
- EnvironmentSuite
-
Discrete ⇐
Hyperparameter
-
Class representing a hyperparameter with a discrete set of possible values
-
Exponential ⇐
Hyperparameter
-
Class representing a hyperparameter in logarithmic space
-
Fixed ⇐
Hyperparameter
-
Class representing a Fixed hyperparameter
-
Linear ⇐
Hyperparameter
-
Class reperesenting a hyperparameter in linear space
Interfaces
- Hyperparameter
-
Interface defining hyperparameter configuration
-
ContinuousEnvironmentFactory ⇐
EnvironmentFactory
-
Interface for an EnvironmentFactory corresponding to an Environment with a single continuous action and a continuous state space. The actions should be bounded by some range. The observation should be an array of numbers.
-
DiscreteEnvironmentFactory ⇐
EnvironmentFactory
-
Interface for an EnvironmentFactory corresponding to an Environment with discrete actions and a continuous state space. The actions should be an array of strings. The observation should be an array of numbers.
-
TabularEnvironmentFactory ⇐
EnvironmentFactory
-
Interface for an EnvironmentFactory corresponding to an Environment with discrete actions and a discrete state space. The actions should be an array of strings.
Hyperparameter
Interface defining hyperparameter configuration
Kind: global interface
-
Hyperparameter
-
.getName() ⇒
string
-
.defaultValue() ⇒
*
-
.randomValue() ⇒
*
-
.discretize(steps) ⇒
array
-
.getName() ⇒
string
hyperparameter.getName() ⇒ Kind: instance method of Hyperparameter
Returns: string
- the name of the hyperparameter
*
hyperparameter.defaultValue() ⇒ Kind: instance method of Hyperparameter
Returns: *
- the default value for the hyperparameter
*
hyperparameter.randomValue() ⇒ Kind: instance method of Hyperparameter
Returns: *
- a randomly chosen value for the hyperparameter
array
hyperparameter.discretize(steps) ⇒ Discretize the range into evenly spaced values
Kind: instance method of Hyperparameter
Returns: array
- an array of hyperparameter values
Param | Type | Description |
---|---|---|
steps | number |
an integer number of steps to discretize the range into |
EnvironmentFactory
ContinuousEnvironmentFactory ⇐ Interface for an EnvironmentFactory corresponding to an Environment with a single continuous action and a continuous state space. The actions should be bounded by some range. The observation should be an array of numbers.
Kind: global interface
Extends: EnvironmentFactory
-
ContinuousEnvironmentFactory ⇐
EnvironmentFactory
-
.getObservationCount() ⇒
number
-
.getActionRange() ⇒
Array.<number>
-
.getObservationCount() ⇒
number
continuousEnvironmentFactory.getObservationCount() ⇒ Kind: instance method of ContinuousEnvironmentFactory
Returns: number
- The size of the observation array for the environment
Array.<number>
continuousEnvironmentFactory.getActionRange() ⇒ Kind: instance method of ContinuousEnvironmentFactory
Returns: Array.<number>
- An array whose first element represents the lower bound of the action, and the second element represents the upper bound.
EnvironmentFactory
DiscreteEnvironmentFactory ⇐ Interface for an EnvironmentFactory corresponding to an Environment with discrete actions and a continuous state space. The actions should be an array of strings. The observation should be an array of numbers.
Kind: global interface
Extends: EnvironmentFactory
-
DiscreteEnvironmentFactory ⇐
EnvironmentFactory
-
.getObservationCount() ⇒
number
-
.getActions() ⇒
Array.<string>
-
.getObservationCount() ⇒
number
discreteEnvironmentFactory.getObservationCount() ⇒ Kind: instance method of DiscreteEnvironmentFactory
Returns: number
- The size of the observation array for the environment
Array.<string>
discreteEnvironmentFactory.getActions() ⇒ Kind: instance method of DiscreteEnvironmentFactory
Returns: Array.<string>
- The action set for the environment
EnvironmentFactory
TabularEnvironmentFactory ⇐ Interface for an EnvironmentFactory corresponding to an Environment with discrete actions and a discrete state space. The actions should be an array of strings.
Kind: global interface
Extends: EnvironmentFactory
-
TabularEnvironmentFactory ⇐
EnvironmentFactory
-
.getStates() ⇒
Array.<string>
-
.getActions() ⇒
Array.<string>
-
.getStates() ⇒
Array.<string>
tabularEnvironmentFactory.getStates() ⇒ Kind: instance method of TabularEnvironmentFactory
Returns: Array.<string>
- The state set for the environment
Array.<string>
tabularEnvironmentFactory.getActions() ⇒ Kind: instance method of TabularEnvironmentFactory
Returns: Array.<string>
- The action set for the environment
AgentBuilder
Kind: global class
new AgentBuilder()
Class defining a builder for AgentFactories. Used for defining the configuration of the resulting Agent
string
agentBuilder.getName() ⇒ Kind: instance method of AgentBuilder
Returns: string
- Display name of the Agent
string
agentBuilder.getId() ⇒ Kind: instance method of AgentBuilder
Returns: string
- The unique identifier for the Agent
object
agentBuilder.getHyperparameterDefinitions() ⇒ Kind: instance method of AgentBuilder
Returns: object
- The hyperparameter definitions and ranges for the Agent
agentBuilder.buildFactory() ⇒
Kind: instance method of AgentBuilder
Returns: A fully configured AgentFactory
agentBuilder.buildAgent() ⇒
Kind: instance method of AgentBuilder
Returns: A fully configured Agent
agentBuilder.setEnvironmentFactory(environmentFactory)
The EnvironmentFactory corresponding to the specific Environment that the AgentFactory should be built for.
Kind: instance method of AgentBuilder
Param | Type |
---|---|
environmentFactory | EnvironmentFactory |
agentBuilder.setHyperparameters(hyperparameters)
The specific set of hyperparameters for the agents constructed by the AgentFactory.
Kind: instance method of AgentBuilder
Param | Type |
---|---|
hyperparameters | Hyperparameters |
agentBuilder.clone() ⇒
Clone this AgentBuilder
Kind: instance method of AgentBuilder
Returns: AgentBuilder
AgentSuite
Kind: global class
-
AgentSuite
- new AgentSuite()
-
.getName() ⇒
string
-
.getId() ⇒
string
-
.listAgents() ⇒
Array.<AgentBuilder>
-
.getAgentBuilder(id) ⇒
AgentBuilder
-
.getEnvironmentType() ⇒
*
new AgentSuite()
Class representing a suite of similar or related agents.
string
agentSuite.getName() ⇒ Kind: instance method of AgentSuite
Returns: string
- Display name of the agent suite
string
agentSuite.getId() ⇒ Kind: instance method of AgentSuite
Returns: string
- Unique ID of the agent suite
Array.<AgentBuilder>
agentSuite.listAgents() ⇒ Kind: instance method of AgentSuite
Returns: Array.<AgentBuilder>
- An array of AgentBuilders
AgentBuilder
agentSuite.getAgentBuilder(id) ⇒ Kind: instance method of AgentSuite
Param | Type | Description |
---|---|---|
id | string |
The unique ID for the AgentBuilder |
*
agentSuite.getEnvironmentType() ⇒ Get the type of the environments that agents in this suite can handle. E.g. DiscreteEnvironmentFactory, TabularEnvironmentFactory, etc.
Kind: instance method of AgentSuite
Returns: *
- An EnvironmentFactory type
EnvironmentBuilder
Kind: global class
-
EnvironmentBuilder
-
.getId() ⇒
string
-
.getName() ⇒
string
-
.buildFactory() ⇒
EnvironmentFactory
-
.getHyperparameterDefinitions() ⇒
object
- .setHyperparameters(hyperparameters)
-
.buildEnvironment() ⇒
Environment
-
.getId() ⇒
string
environmentBuilder.getId() ⇒ Kind: instance method of EnvironmentBuilder
Returns: string
- The unique ID of the EnvironmentBuilder
string
environmentBuilder.getName() ⇒ Kind: instance method of EnvironmentBuilder
Returns: string
- Display name of the EnvironmentBuilder
EnvironmentFactory
environmentBuilder.buildFactory() ⇒ Kind: instance method of EnvironmentBuilder
Returns: EnvironmentFactory
- Get an instance of EnvironmentFactory
object
environmentBuilder.getHyperparameterDefinitions() ⇒ Kind: instance method of EnvironmentBuilder
Returns: object
- The hyperparameter definitions and ranges for the Environment
environmentBuilder.setHyperparameters(hyperparameters)
The specific set of hyperparameters for the agents constructed by the EnvironmentFactory.
Kind: instance method of EnvironmentBuilder
Param | Type |
---|---|
hyperparameters | Hyperparameters |
Environment
environmentBuilder.buildEnvironment() ⇒ Kind: instance method of EnvironmentBuilder
Returns: Environment
- Build an instance of the Environment
EnvironmentSuite
Kind: global class
new EnvironmentSuite()
Class representing a set of similar or related Environments
string
environmentSuite.getName() ⇒ Kind: instance method of EnvironmentSuite
Returns: string
- The display name of the EnvironmentSuite
string
environmentSuite.getId() ⇒ Kind: instance method of EnvironmentSuite
Returns: string
- The unique ID of the EnvironmentSuite
*
environmentSuite.getType() ⇒ Kind: instance method of EnvironmentSuite
Returns: *
- A subclass of EnvironmentFactory corresponding to the EnvironmentType
Array.<EnvironmentBuilder>
environmentSuite.listEnvironments() ⇒ Kind: instance method of EnvironmentSuite
Returns: Array.<EnvironmentBuilder>
- An array of the EnvironmentBuilders
environmentSuite.getEnvironmentBuilder(environmentName) ⇒
Kind: instance method of EnvironmentSuite
Returns: EnvironmentFactory
Param |
---|
environmentName |
Hyperparameter
Discrete ⇐ Class representing a hyperparameter with a discrete set of possible values
Kind: global class
Extends: Hyperparameter
-
Discrete ⇐
Hyperparameter
-
.getName() ⇒
string
-
.defaultValue() ⇒
*
-
.randomValue() ⇒
*
-
.discretize(steps) ⇒
array
-
.getName() ⇒
string
discrete.getName() ⇒ Kind: instance method of Discrete
Overrides: getName
Returns: string
- the name of the hyperparameter
*
discrete.defaultValue() ⇒ Kind: instance method of Discrete
Overrides: defaultValue
Returns: *
- the default value for the hyperparameter
*
discrete.randomValue() ⇒ Kind: instance method of Discrete
Overrides: randomValue
Returns: *
- a randomly chosen value for the hyperparameter
array
discrete.discretize(steps) ⇒ Discretize the range into evenly spaced values
Kind: instance method of Discrete
Overrides: discretize
Returns: array
- an array of hyperparameter values
Param | Type | Description |
---|---|---|
steps | number |
an integer number of steps to discretize the range into |
Hyperparameter
Exponential ⇐ Class representing a hyperparameter in logarithmic space
Kind: global class
Extends: Hyperparameter
-
Exponential ⇐
Hyperparameter
-
.getName() ⇒
string
-
.defaultValue() ⇒
*
-
.randomValue() ⇒
*
-
.discretize(steps) ⇒
array
-
.getName() ⇒
string
exponential.getName() ⇒ Kind: instance method of Exponential
Overrides: getName
Returns: string
- the name of the hyperparameter
*
exponential.defaultValue() ⇒ Kind: instance method of Exponential
Overrides: defaultValue
Returns: *
- the default value for the hyperparameter
*
exponential.randomValue() ⇒ Kind: instance method of Exponential
Overrides: randomValue
Returns: *
- a randomly chosen value for the hyperparameter
array
exponential.discretize(steps) ⇒ Discretize the range into evenly spaced values
Kind: instance method of Exponential
Overrides: discretize
Returns: array
- an array of hyperparameter values
Param | Type | Description |
---|---|---|
steps | number |
an integer number of steps to discretize the range into |
Hyperparameter
Fixed ⇐ Class representing a Fixed hyperparameter
Kind: global class
Extends: Hyperparameter
-
Fixed ⇐
Hyperparameter
-
.getName() ⇒
string
-
.defaultValue() ⇒
*
-
.randomValue() ⇒
*
-
.discretize(steps) ⇒
array
-
.getName() ⇒
string
fixed.getName() ⇒ Kind: instance method of Fixed
Overrides: getName
Returns: string
- the name of the hyperparameter
*
fixed.defaultValue() ⇒ Kind: instance method of Fixed
Overrides: defaultValue
Returns: *
- the default value for the hyperparameter
*
fixed.randomValue() ⇒ Kind: instance method of Fixed
Overrides: randomValue
Returns: *
- a randomly chosen value for the hyperparameter
array
fixed.discretize(steps) ⇒ Discretize the range into evenly spaced values
Kind: instance method of Fixed
Overrides: discretize
Returns: array
- an array of hyperparameter values
Param | Type | Description |
---|---|---|
steps | number |
an integer number of steps to discretize the range into |
Hyperparameter
Linear ⇐ Class reperesenting a hyperparameter in linear space
Kind: global class
Extends: Hyperparameter
-
Linear ⇐
Hyperparameter
-
.getName() ⇒
string
-
.defaultValue() ⇒
*
-
.randomValue() ⇒
*
-
.discretize(steps) ⇒
array
-
.getName() ⇒
string
linear.getName() ⇒ Kind: instance method of Linear
Overrides: getName
Returns: string
- the name of the hyperparameter
*
linear.defaultValue() ⇒ Kind: instance method of Linear
Overrides: defaultValue
Returns: *
- the default value for the hyperparameter
*
linear.randomValue() ⇒ Kind: instance method of Linear
Overrides: randomValue
Returns: *
- a randomly chosen value for the hyperparameter
array
linear.discretize(steps) ⇒ Discretize the range into evenly spaced values
Kind: instance method of Linear
Overrides: discretize
Returns: array
- an array of hyperparameter values
Param | Type | Description |
---|---|---|
steps | number |
an integer number of steps to discretize the range into |