neurotorch package¶
Subpackages¶
- neurotorch.callbacks package
- Submodules
- neurotorch.callbacks.base_callback module
BaseCallback
BaseCallback.DEFAULT_HIGH_PRIORITY
BaseCallback.DEFAULT_LOW_PRIORITY
BaseCallback.DEFAULT_MEDIUM_PRIORITY
BaseCallback.DEFAULT_PRIORITY
BaseCallback.UNPICKEABLE_ATTRIBUTES
BaseCallback.__init__()
BaseCallback.close()
BaseCallback.extra_repr()
BaseCallback.get_checkpoint_state()
BaseCallback.instance_counter
BaseCallback.load_checkpoint_state()
BaseCallback.on_batch_begin()
BaseCallback.on_batch_end()
BaseCallback.on_epoch_begin()
BaseCallback.on_epoch_end()
BaseCallback.on_iteration_begin()
BaseCallback.on_iteration_end()
BaseCallback.on_optimization_begin()
BaseCallback.on_optimization_end()
BaseCallback.on_pbar_update()
BaseCallback.on_train_begin()
BaseCallback.on_train_end()
BaseCallback.on_trajectory_end()
BaseCallback.on_validation_batch_begin()
BaseCallback.on_validation_batch_end()
BaseCallback.on_validation_begin()
BaseCallback.on_validation_end()
BaseCallback.start()
CallbacksList
CallbacksList.__init__()
CallbacksList.append()
CallbacksList.close()
CallbacksList.get_checkpoint_state()
CallbacksList.load_checkpoint_state()
CallbacksList.on_batch_begin()
CallbacksList.on_batch_end()
CallbacksList.on_epoch_begin()
CallbacksList.on_epoch_end()
CallbacksList.on_iteration_begin()
CallbacksList.on_iteration_end()
CallbacksList.on_optimization_begin()
CallbacksList.on_optimization_end()
CallbacksList.on_pbar_update()
CallbacksList.on_train_begin()
CallbacksList.on_train_end()
CallbacksList.on_trajectory_end()
CallbacksList.on_validation_batch_begin()
CallbacksList.on_validation_batch_end()
CallbacksList.on_validation_begin()
CallbacksList.on_validation_end()
CallbacksList.remove()
CallbacksList.sort_callbacks_()
CallbacksList.start()
- neurotorch.callbacks.checkpoints_manager module
CheckpointManager
CheckpointManager.CHECKPOINTS_META_SUFFIX
CheckpointManager.CHECKPOINT_BEST_KEY
CheckpointManager.CHECKPOINT_FILE_STRUCT
CheckpointManager.CHECKPOINT_ITRS_KEY
CheckpointManager.CHECKPOINT_ITR_KEY
CheckpointManager.CHECKPOINT_METRICS_KEY
CheckpointManager.CHECKPOINT_OPTIMIZER_STATE_DICT_KEY
CheckpointManager.CHECKPOINT_SAVE_PATH_KEY
CheckpointManager.CHECKPOINT_STATE_DICT_KEY
CheckpointManager.CHECKPOINT_TRAINING_HISTORY_KEY
CheckpointManager.DEFAULT_PRIORITY
CheckpointManager.SAVE_EXT
CheckpointManager.SUFFIX_SEP
CheckpointManager.__init__()
CheckpointManager.checkpoints_meta_path
CheckpointManager.close()
CheckpointManager.extra_repr()
CheckpointManager.get_checkpoint_filename()
CheckpointManager.get_save_name_from_checkpoints()
CheckpointManager.load_checkpoint()
CheckpointManager.load_mode_to_suffix
CheckpointManager.on_iteration_end()
CheckpointManager.on_pbar_update()
CheckpointManager.save_checkpoint()
CheckpointManager.save_checkpoints_meta()
CheckpointManager.save_on()
CheckpointManager.start()
LoadCheckpointMode
- neurotorch.callbacks.convergence module
- neurotorch.callbacks.early_stopping module
EarlyStopping
EarlyStoppingOnNaN
EarlyStoppingOnStagnation
EarlyStoppingOnTimeLimit
EarlyStoppingOnTimeLimit.CURRENT_SECONDS_COUNT_KEY
EarlyStoppingOnTimeLimit.DELTA_SECONDS_KEY
EarlyStoppingOnTimeLimit.__init__()
EarlyStoppingOnTimeLimit.extra_repr()
EarlyStoppingOnTimeLimit.get_checkpoint_state()
EarlyStoppingOnTimeLimit.load_checkpoint_state()
EarlyStoppingOnTimeLimit.on_iteration_end()
EarlyStoppingOnTimeLimit.start()
EarlyStoppingOnTimeLimit.update_flags()
EarlyStoppingThreshold
- neurotorch.callbacks.events module
- neurotorch.callbacks.history module
TrainingHistory
TrainingHistory.DEFAULT_PRIORITY
TrainingHistory.__init__()
TrainingHistory.append()
TrainingHistory.concat()
TrainingHistory.create_plot()
TrainingHistory.extra_repr()
TrainingHistory.get()
TrainingHistory.get_item_at()
TrainingHistory.insert()
TrainingHistory.items()
TrainingHistory.keys()
TrainingHistory.max()
TrainingHistory.max_item()
TrainingHistory.min()
TrainingHistory.min_item()
TrainingHistory.on_iteration_end()
TrainingHistory.plot()
TrainingHistory.update_fig()
- neurotorch.callbacks.lr_schedulers module
- neurotorch.callbacks.training_visualization module
- Module contents
ForesightTimeStepUpdaterOnTarget
ForesightTimeStepUpdaterOnTarget.DEFAULT_PRIORITY
ForesightTimeStepUpdaterOnTarget.__init__()
ForesightTimeStepUpdaterOnTarget.get_hh_memory_size_from_y_batch()
ForesightTimeStepUpdaterOnTarget.on_batch_begin()
ForesightTimeStepUpdaterOnTarget.on_batch_end()
ForesightTimeStepUpdaterOnTarget.on_train_end()
ForesightTimeStepUpdaterOnTarget.start()
- neurotorch.init package
- neurotorch.learning_algorithms package
- Submodules
- neurotorch.learning_algorithms.bptt module
BPTT
BPTT.CHECKPOINT_OPTIMIZER_STATE_DICT_KEY
BPTT.DEFAULT_OPTIMIZER_CLS
BPTT.OPTIMIZER_PARAMS_GROUP_IDX
BPTT.__init__()
BPTT.apply_criterion()
BPTT.create_default_optimizer()
BPTT.extra_repr()
BPTT.get_checkpoint_state()
BPTT.initialize_param_groups()
BPTT.load_checkpoint_state()
BPTT.on_optimization_begin()
BPTT.on_optimization_end()
BPTT.on_validation_batch_begin()
BPTT.start()
- neurotorch.learning_algorithms.eprop module
Eprop
Eprop.CHECKPOINT_FEEDBACK_WEIGHTS_KEY
Eprop.CHECKPOINT_OPTIMIZER_STATE_DICT_KEY
Eprop.DEFAULT_FEEDBACKS_GEN_STRATEGY
Eprop.DEFAULT_FEEDBACKS_STR_NORM_CLIP_VALUE
Eprop.DEFAULT_OPTIMIZER_CLS
Eprop.DEFAULT_Y_KEY
Eprop.FEEDBACKS_GEN_FUNCS
Eprop.OPTIMIZER_OUTPUT_PARAMS_GROUP_IDX
Eprop.OPTIMIZER_PARAMS_GROUP_IDX
Eprop.__init__()
Eprop.compute_errors()
Eprop.compute_learning_signals()
Eprop.decorate_forwards()
Eprop.eligibility_traces_zeros_()
Eprop.get_checkpoint_state()
Eprop.initialize_feedback_weights()
Eprop.initialize_layers()
Eprop.initialize_output_layers()
Eprop.initialize_output_params()
Eprop.initialize_param_groups()
Eprop.initialize_params()
Eprop.load_checkpoint_state()
Eprop.make_feedback_weights()
Eprop.on_batch_begin()
Eprop.on_batch_end()
Eprop.start()
Eprop.update_grads()
- neurotorch.learning_algorithms.learning_algorithm module
- neurotorch.learning_algorithms.rls module
RLS
RLS.CHECKPOINT_OPTIMIZER_STATE_DICT_KEY
RLS.CHECKPOINT_P_STATES_DICT_KEY
RLS.__init__()
RLS.curbd_step_method()
RLS.get_checkpoint_state()
RLS.grad_mth_step()
RLS.initialize_P_list()
RLS.inputs_mth_step()
RLS.jacobian_mth_step()
RLS.load_checkpoint_state()
RLS.on_batch_begin()
RLS.on_batch_end()
RLS.on_optimization_begin()
RLS.optimization_step()
RLS.outputs_mth_step()
RLS.scaled_jacobian_mth_step()
RLS.start()
- neurotorch.learning_algorithms.tbptt module
- Module contents
- neurotorch.metrics package
- Submodules
- neurotorch.metrics.base module
- neurotorch.metrics.classification module
ClassificationMetrics
ClassificationMetrics.__call__()
ClassificationMetrics.accuracy()
ClassificationMetrics.auc()
ClassificationMetrics.compute_y_true_y_pred()
ClassificationMetrics.confusion_matrix()
ClassificationMetrics.f1()
ClassificationMetrics.get_all_metrics_names_to_func()
ClassificationMetrics.precision()
ClassificationMetrics.recall()
- neurotorch.metrics.losses module
- neurotorch.metrics.regression module
RegressionMetrics
RegressionMetrics.EPSILON
RegressionMetrics.__call__()
RegressionMetrics.compute_p_var()
RegressionMetrics.compute_y_true_y_pred()
RegressionMetrics.d2_tweedie()
RegressionMetrics.get_all_metrics_names_to_func()
RegressionMetrics.mean_absolute_error()
RegressionMetrics.mean_squared_error()
RegressionMetrics.p_var()
RegressionMetrics.r2()
- Module contents
- neurotorch.modules package
- Subpackages
- Submodules
- neurotorch.modules.base module
BaseModel
BaseModel.__call__()
BaseModel.__init__()
BaseModel.apply_input_transform()
BaseModel.apply_output_transform()
BaseModel.build()
BaseModel.checkpoints_meta_path
BaseModel.device
BaseModel.forward()
BaseModel.get_default_input_transform()
BaseModel.get_default_output_transform()
BaseModel.get_prediction_log_proba()
BaseModel.get_prediction_proba()
BaseModel.get_prediction_trace()
BaseModel.get_raw_prediction()
BaseModel.hard_update()
BaseModel.infer_sizes_from_inputs()
BaseModel.input_sizes
BaseModel.is_built
BaseModel.load_checkpoint()
BaseModel.output_sizes
BaseModel.soft_update()
BaseModel.to()
BaseModel.to_onnx()
NamedModule
SizedModule
- neurotorch.modules.functions module
- neurotorch.modules.sequential module
Sequential
Sequential.__init__()
Sequential.build()
Sequential.build_layers()
Sequential.device
Sequential.forward()
Sequential.get_all_layers()
Sequential.get_all_layers_names()
Sequential.get_and_reset_regularization_loss()
Sequential.get_dict_of_layers()
Sequential.get_layer()
Sequential.get_layers()
Sequential.get_prediction_log_proba()
Sequential.get_prediction_proba()
Sequential.get_raw_prediction()
Sequential.infer_sizes_from_inputs()
Sequential.initialize_weights_()
- neurotorch.modules.sequential_rnn module
SequentialRNN
SequentialRNN.__init__()
SequentialRNN.build()
SequentialRNN.forward()
SequentialRNN.get_and_reset_regularization_loss()
SequentialRNN.get_fmt_prediction()
SequentialRNN.get_last_prediction()
SequentialRNN.get_max_prediction()
SequentialRNN.get_mean_prediction()
SequentialRNN.get_prediction_log_proba()
SequentialRNN.get_prediction_proba()
SequentialRNN.get_prediction_trace()
SequentialRNN.get_raw_prediction()
SequentialRNN.hh_memory_size
SequentialRNN.out_memory_size
- neurotorch.modules.spike_funcs module
- neurotorch.modules.utils module
- neurotorch.modules.wrappers module
- Module contents
- neurotorch.regularization package
- neurotorch.rl package
- Submodules
- neurotorch.rl.agent module
Agent
Agent.__init__()
Agent.action_spec
Agent.continuous_actions
Agent.copy()
Agent.copy_critic()
Agent.copy_from_agent()
Agent.copy_policy()
Agent.decay_continuous_action_variances()
Agent.device
Agent.discrete_actions
Agent.format_batch_discrete_actions()
Agent.forward()
Agent.get_actions()
Agent.get_continuous_action_covariances()
Agent.get_default_checkpoints_meta_path()
Agent.get_random_actions()
Agent.get_values()
Agent.hard_update()
Agent.load_checkpoint()
Agent.observation_spec
Agent.set_continuous_action_variances_with_itr()
Agent.set_default_critic_kwargs()
Agent.set_default_policy_kwargs()
Agent.soft_update()
Agent.to()
- neurotorch.rl.buffers module
AgentsHistoryMaps
AgentsHistoryMaps.trajectories
AgentsHistoryMaps.cumulative_rewards
AgentsHistoryMaps.__init__()
AgentsHistoryMaps.clear()
AgentsHistoryMaps.cumulative_rewards_as_array
AgentsHistoryMaps.experience_count
AgentsHistoryMaps.max_abs_rewards
AgentsHistoryMaps.mean_cumulative_rewards
AgentsHistoryMaps.propagate_all()
AgentsHistoryMaps.propagate_and_get_all()
AgentsHistoryMaps.terminals_count
AgentsHistoryMaps.update_trajectories_()
BatchExperience
Experience
ReplayBuffer
ReplayBuffer.__init__()
ReplayBuffer.capacity
ReplayBuffer.clear()
ReplayBuffer.counter
ReplayBuffer.empty
ReplayBuffer.extend()
ReplayBuffer.full
ReplayBuffer.get_batch_generator()
ReplayBuffer.get_batch_tensor()
ReplayBuffer.get_random_batch()
ReplayBuffer.increase_capacity()
ReplayBuffer.increment_counter()
ReplayBuffer.load()
ReplayBuffer.reset_counter()
ReplayBuffer.save()
ReplayBuffer.set_seed()
ReplayBuffer.start_counter()
ReplayBuffer.stop_counter()
ReplayBuffer.store()
Trajectory
Trajectory.__init__()
Trajectory.append()
Trajectory.append_and_propagate()
Trajectory.compute_horizon_rewards()
Trajectory.cumulative_reward
Trajectory.is_empty()
Trajectory.make_rewards_horizon()
Trajectory.propagate()
Trajectory.propagate_rewards()
Trajectory.propagate_values()
Trajectory.propagated
Trajectory.terminal
Trajectory.terminal_reward
Trajectory.terminated
Trajectory.update_others()
- neurotorch.rl.curriculum module
CompletionCriteria
Curriculum
Curriculum.__init__()
Curriculum.add_lesson()
Curriculum.channels
Curriculum.current_lesson
Curriculum.is_completed
Curriculum.lessons
Curriculum.map_repr
Curriculum.on_iteration_end()
Curriculum.on_iteration_start()
Curriculum.teacher_buffer
Curriculum.teachers
Curriculum.update_channels()
Curriculum.update_teachers()
Curriculum.update_teachers_and_channels()
CurriculumEndIterationOutput
Lesson
- neurotorch.rl.ppo module
PPO
PPO.CHECKPOINT_OPTIMIZER_STATE_DICT_KEY
PPO.__init__()
PPO.agent
PPO.critic
PPO.get_actions_from_batch()
PPO.get_advantages_from_batch()
PPO.get_checkpoint_state()
PPO.get_returns_from_batch()
PPO.get_values_from_batch()
PPO.last_policy
PPO.load_checkpoint_state()
PPO.on_iteration_begin()
PPO.on_optimization_begin()
PPO.on_optimization_end()
PPO.on_pbar_update()
PPO.on_trajectory_end()
PPO.policy
PPO.start()
PPO.update_params()
- neurotorch.rl.rl_academy module
GenTrajectoriesOutput
RLAcademy
RLAcademy.CUM_REWARDS_METRIC_KEY
RLAcademy.TERMINAL_REWARDS_METRIC_KEY
RLAcademy.__init__()
RLAcademy.close()
RLAcademy.copy_agent()
RLAcademy.copy_policy()
RLAcademy.env
RLAcademy.generate_trajectories()
RLAcademy.policy
RLAcademy.reset_agents_history_maps_meta()
RLAcademy.set_default_academy_kwargs()
RLAcademy.train()
- neurotorch.rl.utils module
Linear
TrainingHistoriesMap
TrajectoryRenderer
batch_dict_of_items()
batch_numpy_actions()
continuous_actions_distribution()
discounted_cumulative_sums()
env_batch_render()
env_batch_reset()
env_batch_step()
format_numpy_actions()
get_item_from_batch()
get_single_action_space()
get_single_observation_space()
obs_batch_to_sequence()
obs_sequence_to_batch()
sample_action_space()
space_to_continuous_shape()
space_to_spec()
- Module contents
- neurotorch.trainers package
- Submodules
- neurotorch.trainers.classification module
- neurotorch.trainers.regression module
- neurotorch.trainers.trainer module
CurrentTrainingState
CurrentTrainingState.batch
CurrentTrainingState.batch_is_train
CurrentTrainingState.batch_loss
CurrentTrainingState.epoch
CurrentTrainingState.epoch_loss
CurrentTrainingState.get_null_state()
CurrentTrainingState.hh_batch
CurrentTrainingState.info
CurrentTrainingState.iteration
CurrentTrainingState.itr_metrics
CurrentTrainingState.n_epochs
CurrentTrainingState.n_iterations
CurrentTrainingState.objects
CurrentTrainingState.pred_batch
CurrentTrainingState.stop_training_flag
CurrentTrainingState.train_loss
CurrentTrainingState.train_metrics
CurrentTrainingState.update()
CurrentTrainingState.val_loss
CurrentTrainingState.val_metrics
CurrentTrainingState.x_batch
CurrentTrainingState.y_batch
Trainer
Trainer.__init__()
Trainer.apply_criterion_on_batch()
Trainer.checkpoint_managers
Trainer.force_overwrite
Trainer.get_pred_batch()
Trainer.learning_algorithms
Trainer.load_checkpoint_mode
Trainer.load_state()
Trainer.network
Trainer.sort_callbacks_()
Trainer.state
Trainer.train()
Trainer.training_histories
Trainer.update_info_state_()
Trainer.update_itr_metrics_state_()
Trainer.update_objects_state_()
Trainer.update_state_()
TrainingState
- Module contents
- neurotorch.transforms package
- Submodules
- neurotorch.transforms.base module
- neurotorch.transforms.spikes_auto_encoder module
- neurotorch.transforms.spikes_decoders module
- neurotorch.transforms.spikes_encoders module
- neurotorch.transforms.vision module
- neurotorch.transforms.wrappers module
- Module contents
- neurotorch.utils package
- Submodules
- neurotorch.utils.autograd module
- neurotorch.utils.collections module
get_all_params_combinations()
get_meta_name()
get_meta_str()
hash_meta_str()
hash_params()
list_insert_replace_at()
list_of_callable_to_sequential()
mapping_update_recursively()
maybe_unpack_singleton_dict()
save_params()
sequence_get()
unpack_out_hh()
unpack_singleton_dict()
unpack_tuple()
unpack_x_hh_y()
- neurotorch.utils.formatting module
- neurotorch.utils.random module
- neurotorch.utils.visualise module
- Module contents
- neurotorch.visualisation package
Submodules¶
neurotorch.dimension module¶
- class neurotorch.dimension.Dimension(size: int | None = None, dtype: DimensionProperty = DimensionProperty.NONE, name: str | None = None)¶
Bases:
object
This object is used to represent a dimension.
- size¶
The size of the dimension.
- Type:
int
- dtype¶
The type of the dimension.
- Type:
- name¶
The name of the dimension.
- Type:
str
- __init__(size: int | None = None, dtype: DimensionProperty = DimensionProperty.NONE, name: str | None = None)¶
Constructor for Dimension.
- Parameters:
size (int) – The size of the dimension.
dtype (DimensionProperty) – The type of the dimension.
name (str) – The name of the dimension.
- static from_int(size: int | None) Dimension ¶
Create a Dimension from an integer.
- Parameters:
size (int) – The size of the dimension.
- Returns:
A dimension with the given size and None as dtype.
- Return type:
- static from_int_or_dimension(dimension: int | Dimension | None) Dimension ¶
Create a Dimension from an integer or a Dimension.
- Parameters:
dimension (int or Dimension) – The dimension to convert.
- Returns:
A dimension with the given size and None as dtype if the input is an integer and the given dimension
if it is a Dimension. :rtype: Dimension
- class neurotorch.dimension.DimensionProperty(value)¶
Bases:
Enum
Enum for dimension properties.
NONE: No dimension property. This type of dimension can be used for features, neurons, unknown, etc. TIME: Time dimension. This type of dimension can be used for time series. SPATIAL: Spatial dimension. This type of dimension can be used for spatial data like images, videos, etc.
- NONE = 0¶
- SPATIAL = 2¶
- TIME = 1¶
Module contents¶
NeuroTorch: A Python library for machine learning and neuroscience.