MCPcopy Create free account

hub / github.com/SakanaAI/continuous-thought-machines / functions

Functions375 in github.com/SakanaAI/continuous-thought-machines

↓ 39 callersMethodload_state_dict
(self, state_dict)
utils/schedulers.py:97
↓ 32 callersMethodstate_dict
(self)
utils/schedulers.py:94
↓ 22 callersFunctionis_main_process
(rank)
tasks/mazes/train_distributed.py:168
↓ 21 callersFunctionis_main_process
(rank)
tasks/image_classification/train_distributed.py:170
↓ 19 callersMethodstep
(self, action)
tasks/rl/envs.py:17
↓ 18 callersFunctionmaze_loss
Computes the maze loss with auto-extending cirriculum. Predictions are of shape: (B, route_length, class, internal_ticks), where cla
utils/losses.py:85
↓ 15 callersMethod__init__
(self, dim)
models/modules.py:36
↓ 12 callersFunctionimage_classification_loss
Computes the maze loss with auto-extending cirriculum. Predictions are of shape: (B, class, internal_ticks), Certainties are of shape: (
utils/losses.py:58
↓ 12 callersFunctionplot_neural_dynamics
(post_activations_history, N_to_plot, save_location, axis_snap=False, N_per_row=5, which_neurons_mid=None, mid
tasks/image_classification/plotting.py:230
↓ 12 callersFunctionset_seed
... and the answer is ...
utils/housekeeping.py:27
↓ 8 callersMethod__getitem__
(self, idx)
data/custom_datasets.py:136
↓ 8 callersMethodcompute_synchronisation
Computes synchronisation to be used as a vector representation. A neuron has what we call a 'trace', which is a history (time serie
models/ctm.py:202
↓ 8 callersFunctionctm_factory
()
tests/conftest.py:277
↓ 7 callersFunctionget_model_args_from_checkpoint
(checkpoint)
models/utils.py:110
↓ 7 callersFunctionload_checkpoint
(checkpoint_path, device)
models/utils.py:106
↓ 7 callersFunctionreshape_predictions
(predictions, prediction_reshaper)
models/utils.py:74
↓ 7 callersFunctionsave_frames_to_mp4
Saves a list of NumPy array frames to an MP4 video file using FFmpeg via subprocess. Includes fix for odd frame dimensions by padding to the
tasks/image_classification/plotting.py:25
↓ 7 callersFunctionzip_python_code
Zips all .py files in the current repository and saves it to the specified output filename. Args: output_filename: The name of
utils/housekeeping.py:10
↓ 6 callersFunctiondraw_path
Draws a path on a maze image based on a given route. Args: maze: A numpy array representing the maze image. route: A list of
tasks/mazes/plotting.py:31
↓ 6 callersMethodget_action_and_value
(self, x, ctm_state, done, action=None, track=False)
tasks/rl/train.py:247
↓ 6 callersFunctionget_latest_checkpoint_file
(filepath, limit=300000)
models/utils.py:91
↓ 6 callersFunctionlayer_init
(layer, std=np.sqrt(2), bias_const=0.0)
tasks/rl/train.py:105
↓ 6 callersFunctionreshape_attention_weights
(attention_weights)
tasks/parity/utils.py:47
↓ 5 callersFunction_resnet
(in_channels, feature_scales, stride, arch, block, layers, pretrained, progress, device, do_initial_max_pool,
models/resnet.py:286
↓ 5 callersMethodget_initial_state
(self, num_envs)
tasks/rl/train.py:165
↓ 4 callersMethod_make_layer
(self, block, planes, blocks, stride=1, dilate=False)
models/resnet.py:227
↓ 4 callersFunctioncompute_normalized_entropy
Calculates the normalized entropy of a PyTorch tensor of logits along the final dimension. Args: logits: A PyTorch tensor of logi
models/utils.py:42
↓ 4 callersFunctionget_dataset
(q_num_images, q_num_images_delta, q_num_repeats_per_input, q_num_operations, q_num_operations_delta)
tasks/qamnist/utils.py:8
↓ 4 callersFunctionget_where_most_certain
(certainties)
tasks/parity/utils.py:59
↓ 4 callersFunctionparse_folder_name
(folder_path)
tasks/parity/utils.py:62
↓ 4 callersFunctionqamnist_model_factory
(qamnist_params)
tests/conftest.py:351
↓ 4 callersMethodreset
(self, **kwargs)
tasks/rl/envs.py:13
↓ 3 callersFunctionbuild_model_from_checkpoint_path
(checkpoint_path, model_type, device="cpu")
tasks/parity/analysis/run.py:127
↓ 3 callersFunctioncombine_tracking_data
(tracking_history)
tasks/rl/utils.py:3
↓ 3 callersMethodcompute_certainty
Compute the certainty of the current prediction.
models/lstm.py:86
↓ 3 callersFunctionconv1x1
1x1 convolution
models/resnet.py:30
↓ 3 callersFunctionconv3x3
3x3 convolution with padding
models/resnet.py:16
↓ 3 callersFunctiondecode_predictions
Decodes the predictions using greedy decoding (best path), correctly handling duplicates. Args: predictions: A tensor of shape [B, C
tasks/sort/utils.py:4
↓ 3 callersFunctionfind_island_centers
Finds the center of mass of each island (connected component > threshold) in a 2D array, weighted by the array's values. Returns list of
tasks/image_classification/analysis/run_imagenet_analysis.py:38
↓ 3 callersFunctionmake_env_classic_control
(env_id, max_environment_steps, mask_velocity=True, render_mode=None)
tasks/rl/train.py:85
↓ 3 callersFunctionmake_env_minigrid
(env_id, max_environment_steps)
tasks/rl/train.py:95
↓ 3 callersFunctionparity_ctm_model
(parity_params, device)
tests/conftest.py:295
↓ 3 callersFunctionparity_loss
Computes the parity loss. Predictions are of shape: (B, parity_sequence_length, class, internal_ticks), where classes are in [0,1,2,
utils/losses.py:139
↓ 3 callersFunctionprepare_data_for_analysis
(num_images, num_operations, args)
tasks/qamnist/analysis/run.py:45
↓ 3 callersFunctionprepare_model
(args, device)
tasks/qamnist/utils.py:21
↓ 3 callersFunctionqamnist_loss
Computes the qamnist loss over the last num_answer_steps steps. Predictions are of shape: (B, class, internal_ticks), Certainties are of
utils/losses.py:174
↓ 3 callersFunctionreshape_inputs
(inputs, iterations, grid_size)
tasks/parity/utils.py:55
↓ 3 callersFunctionsort_loss
The sort task was used partly to show that ctc loss can work.
utils/losses.py:51
↓ 2 callersMethod__init__
( self, in_channels, feature_scales, stride, block, layers,
models/resnet.py:142
↓ 2 callersMethod__len__
(self)
data/custom_datasets.py:199
↓ 2 callersMethod_apply_velocity_mask
(self, observation)
tasks/rl/envs.py:21
↓ 2 callersMethod_get_hidden_states
(self, state, done, num_envs)
tasks/rl/train.py:183
↓ 2 callersFunction_load_ctm_model
Loads the ContinuousThoughtMachine model from a checkpoint.
tasks/mazes/analysis/run.py:94
↓ 2 callersFunctioncalculate_corrects
(predictions, targets)
tasks/parity/analysis/run.py:32
↓ 2 callersMethodcalculate_synch_representation_size
Calculate the size of the synchronisation representation based on neuron selection type.
models/ctm.py:512
↓ 2 callersMethoddetermine_step_type
(self, stepi: int)
models/modules.py:299
↓ 2 callersMethoddetermine_step_type
Determine whether the current step is for digits, questions, or answers.
models/ctm_qamnist.py:73
↓ 2 callersFunctionextract_run_name
(folder, run_index=None)
tasks/parity/plotting.py:624
↓ 2 callersFunctionfind_island_centers
Finds the center of mass of each island (connected component) in a 2D array. Args: array_2d: A 2D numpy array of values. thr
tasks/image_classification/plotting.py:204
↓ 2 callersFunctionget_accuracy_and_loss_from_checkpoint
(checkpoint, device="cpu")
models/utils.py:116
↓ 2 callersFunctionget_all_log_dirs
(root_dir)
models/utils.py:80
↓ 2 callersFunctionget_checkpoint_files
(filepath)
models/utils.py:100
↓ 2 callersFunctionget_checkpoint_paths_for_environment
(environment, log_dir)
tasks/rl/analysis/run.py:35
↓ 2 callersFunctionget_corrects_per_element_at_most_certain_time
(predictions, certainty, targets)
tasks/parity/analysis/run.py:37
↓ 2 callersMethodget_d_backbone
Get the dimensionality of the backbone output, to be used for positional embedding setup. This is a little bit complicated for resne
models/ctm.py:306
↓ 2 callersMethodget_d_backbone
Get the dimensionality of the backbone output, to be used for positional embedding setup. This is a little bit complicated for resne
models/lstm.py:103
↓ 2 callersFunctionget_dataset
(dataset, root)
tasks/image_classification/train.py:127
↓ 2 callersMethodget_initial_ctm_state
(self, num_envs)
tasks/rl/train.py:173
↓ 2 callersMethodget_initial_lstm_state
(self, num_envs)
tasks/rl/train.py:178
↓ 2 callersFunctionget_latest_checkpoint
(log_dir)
models/utils.py:87
↓ 2 callersFunctionget_size_action_space
(env_id)
tasks/rl/analysis/run.py:239
↓ 2 callersMethodget_states
(self, x, ctm_state, done, track=False)
tasks/rl/train.py:213
↓ 2 callersFunctionget_training_data_from_checkpoint_path
(checkpoint_path, device)
tasks/rl/analysis/run.py:211
↓ 2 callersMethodinitialize_left_right_neurons
Initialize the left and right neuron indices based on the neuron selection type. This complexity is owing to legacy experiments, but
models/ctm.py:450
↓ 2 callersFunctionload_checkpoint
(checkpoint_path, device)
tasks/rl/analysis/run.py:46
↓ 2 callersFunctionload_model
(agent, optimizer, checkpoint_path, device)
tasks/rl/train.py:271
↓ 2 callersFunctionmake_classification_gif
(image, target, predictions, certainties, post_activations, attention_tracking, class_labels, save_location)
tasks/image_classification/plotting.py:304
↓ 2 callersFunctionmake_maze_gif
Expect inputs, predictions, targets as numpy arrays
tasks/mazes/plotting.py:91
↓ 2 callersFunctionplot
(grouped_data, scale=1, value_key='rewards', ylabel="Rewards", title="Episode Rewards", save_path="episode_rew
tasks/rl/analysis/run.py:117
↓ 2 callersFunctionplot_activations
(agent, device, args)
tasks/rl/train.py:289
↓ 2 callersFunctionplot_attention_trajectory
(attention, certainties, input_images, save_dir, filename, args)
tasks/parity/plotting.py:165
↓ 2 callersFunctionplot_training_curve_all_runs
(all_folders, save_dir, scale, device, smooth=False, x_max=None, plot_individual_runs=True)
tasks/parity/plotting.py:758
↓ 2 callersFunctionprepare_env
(env_id, max_environment_steps, mask_velocity, render_mode)
tasks/rl/analysis/run.py:249
↓ 2 callersFunctionprepare_model
(prediction_reshaper, args, device)
tasks/parity/utils.py:7
↓ 2 callersFunctionprepare_resnet_backbone
(backbone_type)
models/resnet.py:352
↓ 2 callersMethodset_epoch
Sets the epoch for this sampler. This is used to vary the random seed sequence each time __iter__ is called.
utils/samplers.py:85
↓ 2 callersMethodset_synchronisation_parameters
1. Set the buffers for selecting neurons so that these indices are saved into the model state_dict. 2. Set the parameters for
models/ctm.py:437
↓ 1 callersMethod__init__
(self, warmup_steps)
utils/schedulers.py:7
↓ 1 callersMethod__init__
Most simple form of the custom dataset structure. Args: base_dataset (Dataset): The base dataset to sample from.
data/custom_datasets.py:118
↓ 1 callersMethod__len__
(self)
data/custom_datasets.py:103
↓ 1 callersMethod__len__
(self)
data/custom_datasets.py:133
↓ 1 callersMethod_apply_velocity_mask_acrobot
(self, observation)
tasks/rl/envs.py:33
↓ 1 callersMethod_apply_velocity_mask_cartpole
(self, observation)
tasks/rl/envs.py:30
↓ 1 callersMethod_calculate_num_images_range
(self)
data/custom_datasets.py:44
↓ 1 callersMethod_calculate_num_operations_range
(self)
data/custom_datasets.py:50
↓ 1 callersMethod_get_ctm_hidden_states
(self, ctm_state, done, num_envs)
tasks/rl/train.py:202
↓ 1 callersMethod_get_lstm_hidden_states
(self, lstm_state, done, num_envs)
tasks/rl/train.py:192
↓ 1 callersMethod_get_target_and_question
(self, targets)
data/custom_datasets.py:62
↓ 1 callersMethod_infinite_indices
A generator that yields random indices indefinitely.
utils/samplers.py:61
↓ 1 callersMethod_preload
(self)
data/custom_datasets.py:185
next →1–100 of 375, ranked by callers