-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9f6a2cb
Showing
28 changed files
with
9,602 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sitemap: https://cjgo.github.io/ChewC/sitemap.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[ | ||
{ | ||
"objectID": "03_Policy.html", | ||
"href": "03_Policy.html", | ||
"title": "ChewC", | ||
"section": "", | ||
"text": "source\n\nMultiScalarPolicy\n\n MultiScalarPolicy (*args, **kwargs)\n\n*Policy class for actor-critic algorithms (has both policy and value prediction). Used by A2C, PPO and the likes.\n:param observation_space: Observation space :param action_space: Action space :param lr_schedule: Learning rate schedule (could be constant) :param net_arch: The specification of the policy and value networks. :param activation_fn: Activation function :param ortho_init: Whether to use or not orthogonal initialization :param use_sde: Whether to use State Dependent Exploration or not :param log_std_init: Initial value for the log standard deviation :param full_std: Whether to use (n_features x n_actions) parameters for the std instead of only (n_features,) when using gSDE :param use_expln: Use expln() function instead of exp() to ensure a positive standard deviation (cf paper). It allows to keep variance above zero and prevent it from growing too fast. In practice, exp() is usually enough. :param squash_output: Whether to squash the output using a tanh function, this allows to ensure boundaries when using gSDE. :param features_extractor_class: Features extractor to use. :param features_extractor_kwargs: Keyword arguments to pass to the features extractor. :param share_features_extractor: If True, the features extractor is shared between the policy and value networks. :param normalize_images: Whether to normalize images or not, dividing by 255.0 (True by default) :param optimizer_class: The optimizer to use, th.optim.Adam by default :param optimizer_kwargs: Additional keyword arguments, excluding the learning rate, to pass to the optimizer*\n\nsource\n\n\nMultiScalarFeatureExtractor\n\n MultiScalarFeatureExtractor (observation_space:gymnasium.spaces.box.Box,\n features_dim:int=64)\n\n*Base class that represents a features extractor.\n:param observation_space: :param features_dim: Number of features extracted.*\n\nsource\n\n\nCustomActorCriticPolicy\n\n CustomActorCriticPolicy (observation_space:gymnasium.spaces.space.Space,\n action_space:gymnasium.spaces.space.Space,\n lr_schedule:Callable[[float],float], *args,\n **kwargs)\n\n*Policy class for actor-critic algorithms (has both policy and value prediction). Used by A2C, PPO and the likes.\n:param observation_space: Observation space :param action_space: Action space :param lr_schedule: Learning rate schedule (could be constant) :param net_arch: The specification of the policy and value networks. :param activation_fn: Activation function :param ortho_init: Whether to use or not orthogonal initialization :param use_sde: Whether to use State Dependent Exploration or not :param log_std_init: Initial value for the log standard deviation :param full_std: Whether to use (n_features x n_actions) parameters for the std instead of only (n_features,) when using gSDE :param use_expln: Use expln() function instead of exp() to ensure a positive standard deviation (cf paper). It allows to keep variance above zero and prevent it from growing too fast. In practice, exp() is usually enough. :param squash_output: Whether to squash the output using a tanh function, this allows to ensure boundaries when using gSDE. :param features_extractor_class: Features extractor to use. :param features_extractor_kwargs: Keyword arguments to pass to the features extractor. :param share_features_extractor: If True, the features extractor is shared between the policy and value networks. :param normalize_images: Whether to normalize images or not, dividing by 255.0 (True by default) :param optimizer_class: The optimizer to use, th.optim.Adam by default :param optimizer_kwargs: Additional keyword arguments, excluding the learning rate, to pass to the optimizer*\n\nsource\n\n\nCustomNetwork\n\n CustomNetwork (feature_dim:int, last_layer_dim_pi:int=64,\n last_layer_dim_vf:int=64)\n\n*Base class for all neural network modules.\nYour models should also subclass this class.\nModules can also contain other Modules, allowing to nest them in a tree structure. You can assign the submodules as regular attributes::\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass Model(nn.Module):\n def __init__(self):\n super().__init__()\n self.conv1 = nn.Conv2d(1, 20, 5)\n self.conv2 = nn.Conv2d(20, 20, 5)\n\n def forward(self, x):\n x = F.relu(self.conv1(x))\n return F.relu(self.conv2(x))\nSubmodules assigned in this way will be registered, and will have their parameters converted too when you call :meth:to, etc.\n.. note:: As per the example above, an __init__() call to the parent class must be made before assignment on the child.\n:ivar training: Boolean represents whether this module is in training or evaluation mode. :vartype training: bool*\n\nsource\n\n\nCustomFeatureExtractor\n\n CustomFeatureExtractor (observation_space:gymnasium.spaces.dict.Dict)\n\n*Base class that represents a features extractor.\n:param observation_space: :param features_dim: Number of features extracted.*", | ||
"crumbs": [ | ||
"03_Policy.html" | ||
] | ||
}, | ||
{ | ||
"objectID": "04_lab.html", | ||
"href": "04_lab.html", | ||
"title": "ChewC", | ||
"section": "", | ||
"text": "source\n\nSelectionIntensityEnvironment\n\n SelectionIntensityEnvironment (SP, config)\n\n*The main Gymnasium class for implementing Reinforcement Learning Agents environments.\nThe class encapsulates an environment with arbitrary behind-the-scenes dynamics through the :meth:step and :meth:reset functions. An environment can be partially or fully observed by single agents. For multi-agent environments, see PettingZoo.\nThe main API methods that users of this class need to know are:\n\n:meth:step - Updates an environment with actions returning the next agent observation, the reward for taking that actions, if the environment has terminated or truncated due to the latest action and information from the environment about the step, i.e. metrics, debug info.\n:meth:reset - Resets the environment to an initial state, required before calling step. Returns the first agent observation for an episode and information, i.e. metrics, debug info.\n:meth:render - Renders the environments to help visualise what the agent see, examples modes are “human”, “rgb_array”, “ansi” for text.\n:meth:close - Closes the environment, important when external software is used, i.e. pygame for rendering, databases\n\nEnvironments have additional attributes for users to understand the implementation\n\n:attr:action_space - The Space object corresponding to valid actions, all valid actions should be contained within the space.\n:attr:observation_space - The Space object corresponding to valid observations, all valid observations should be contained within the space.\n:attr:reward_range - A tuple corresponding to the minimum and maximum possible rewards for an agent over an episode. The default reward range is set to :math:(-\\infty,+\\infty).\n:attr:spec - An environment spec that contains the information used to initialize the environment from :meth:gymnasium.make\n:attr:metadata - The metadata of the environment, i.e. render modes, render fps\n:attr:np_random - The random number generator for the environment. This is automatically assigned during super().reset(seed=seed) and when assessing self.np_random.\n\n.. seealso:: For modifying or extending environments use the :py:class:gymnasium.Wrapper class\nNote: To get reproducible sampling of actions, a seed can be set with env.action_space.seed(123).*", | ||
"crumbs": [ | ||
"04_lab.html" | ||
] | ||
}, | ||
{ | ||
"objectID": "00_config.html", | ||
"href": "00_config.html", | ||
"title": "ChewC", | ||
"section": "", | ||
"text": "source\n\ncreate_simulation\n\n create_simulation (config=None)\n\n\nsource\n\n\nget_default_config\n\n get_default_config ()\n\n\nsource\n\n\nset_seed\n\n set_seed (seed)\n\n\nenv = create_simulation()\n\n{'observation_config': {'remaining_proportion': {'type': 'scalar', 'low': 0, 'high': 1}, 'genetic_variance': {'type': 'scalar', 'low': 0, 'high': inf}, 'mean_phenotype': {'type': 'scalar', 'low': -inf, 'high': inf}, 'max_breeding_value': {'type': 'scalar', 'low': -inf, 'high': inf}}, 'start_gen': 2, 'end_gen': 10, 'curriculum_steps': 100000, 'action_low': 0.01, 'action_high': 0.99, 'sparse_reward': True, 'n_parents': 10, 'n_chr': 1, 'n_loci': 100, 'pop_size': 200, 'h2': 0.5, 'target_mean': 0, 'target_variance': 1, 'reps': 1, 'total_timesteps': 100000, 'learning_rate': 0.0003, 'gae_lambda': 0.95, 'log_freq': 100, 'start_gae_lambda': 0.9, 'end_gae_lambda': 0.95, 'seed': None}", | ||
"crumbs": [ | ||
"00_config.html" | ||
] | ||
}, | ||
{ | ||
"objectID": "02_Callback.html", | ||
"href": "02_Callback.html", | ||
"title": "ChewC", | ||
"section": "", | ||
"text": "source\n\nAverageFinalGenerationCallback\n\n AverageFinalGenerationCallback (log_freq=100, verbose=0)\n\n*Base class for callback.\n:param verbose: Verbosity level: 0 for no output, 1 for info messages, 2 for debug messages*\n\nsource\n\n\nActionTrackingCallback\n\n ActionTrackingCallback (log_freq=100, verbose=0)\n\n*Base class for callback.\n:param verbose: Verbosity level: 0 for no output, 1 for info messages, 2 for debug messages*", | ||
"crumbs": [ | ||
"02_Callback.html" | ||
] | ||
}, | ||
{ | ||
"objectID": "05_utils.html", | ||
"href": "05_utils.html", | ||
"title": "ChewC", | ||
"section": "", | ||
"text": "source\n\nplot_best_run\n\n plot_best_run (results, best_action)\n\n\nsource\n\n\ncollect_baselines\n\n collect_baselines (env, actions, repetitions=10, cycles=5)", | ||
"crumbs": [ | ||
"05_utils.html" | ||
] | ||
}, | ||
{ | ||
"objectID": "01_Sim.html", | ||
"href": "01_Sim.html", | ||
"title": "ChewC", | ||
"section": "", | ||
"text": "source\n\nphenotype\n\n phenotype (population, trait, h2)\n\n\nsource\n\n\nrandom_crosses\n\n random_crosses (parent_population, total_crosses, device='cpu',\n seed=None)\n\n\nsource\n\n\ncreate_progeny\n\n create_progeny (mother_gametes, father_gametes, reps=1, device='cpu')\n\n\nsource\n\n\nbreed\n\n breed (mother_tensor, father_tensor, recombination_rate=0.1)\n\n\nsource\n\n\nrecombine\n\n recombine (parent_haplo_tensor, recombination_rate=0.1)\n\n\nsource\n\n\nupdate_pop\n\n update_pop (population, haplotype_pop_tensor)\n\n\nsource\n\n\ncreate_random_pop\n\n create_random_pop (G, pop_size)\n\n\nsource\n\n\ncreate_pop\n\n create_pop (G, haplotypes)\n\n\nsource\n\n\nbv\n\n bv (P, T)\n\n\nsource\n\n\ntruncation_selection\n\n truncation_selection (population, trait, top_percent)\n\n\nsource\n\n\ncalculate_breeding_value\n\n calculate_breeding_value (population, trait, device='cpu')\n\n\nsource\n\n\nscale_values\n\n scale_values (x, from_range=(-1, 1), to_range=(0.05, 0.95))\n\n\nsource\n\n\nSimParams\n\n SimParams (founder_pop, config)\n\nInitialize self. See help(type(self)) for accurate signature.\n\nsource\n\n\nSimOperations\n\n SimOperations ()\n\nInitialize self. See help(type(self)) for accurate signature.\n\nsource\n\n\nTrait\n\n Trait (genome, founder_population, target_mean, target_variance,\n device='cpu', seed=None)\n\nInitialize self. See help(type(self)) for accurate signature.\n\nsource\n\n\nPopulation\n\n Population (genome, haplotypes, device='cpu')\n\nInitialize self. See help(type(self)) for accurate signature.\n\nsource\n\n\nGenome\n\n Genome (n_chr, n_loci, seed=None)\n\nInitialize self. See help(type(self)) for accurate signature.\n\nsource\n\n\nset_seed\n\n set_seed (seed)", | ||
"crumbs": [ | ||
"01_Sim.html" | ||
] | ||
} | ||
] |
Oops, something went wrong.