Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SakanaAI/continuous-thought-machines
/ types & classes
Types & classes
41 in github.com/SakanaAI/continuous-thought-machines
⨍
Functions
375
◇
Types & classes
41
↓ 10 callers
Class
ContinuousThoughtMachine
Continuous Thought Machine (CTM). Technical report: https://arxiv.org/abs/2505.05522 Interactive Website: https://pub.sakana.ai/ctm/
models/ctm.py:17
↓ 7 callers
Class
WarmupCosineAnnealingLR
utils/schedulers.py:16
↓ 7 callers
Class
WarmupMultiStepLR
utils/schedulers.py:75
↓ 7 callers
Class
warmup
utils/schedulers.py:6
↓ 6 callers
Class
Identity
Identity Module. Returns the input tensor unchanged. Useful as a placeholder or a no-op layer in nn.Sequential containers or conditional
models/modules.py:12
↓ 6 callers
Class
MazeImageFolder
A custom dataset class that extends the ImageFolder class. Args: root (string): Root directory path. transform (callable, op
data/custom_datasets.py:142
↓ 5 callers
Class
LSTMBaseline
LSTM Baseline Args: iterations (int): Number of internal 'thought' steps (T, in paper). d_model (int): Core dimensionality o
models/lstm.py:15
↓ 5 callers
Class
ParityDataset
data/custom_datasets.py:310
↓ 5 callers
Class
QAMNISTSampler
utils/samplers.py:92
↓ 4 callers
Class
Agent
tasks/rl/train.py:110
↓ 4 callers
Class
FFBaseline
LSTM Baseline. Wrapper that lets us use the same backbone as the CTM and LSTM baselines, with a Args: d_model (int): workarou
models/ff.py:8
↓ 4 callers
Class
ImageNet
data/custom_datasets.py:117
↓ 4 callers
Class
Squeeze
Squeeze Module. Removes a specified dimension of size 1 from the input tensor. Useful for incorporating tensor dimension squeezing withi
models/modules.py:26
↓ 3 callers
Class
ContinuousThoughtMachineQAMNIST
models/ctm_qamnist.py:6
↓ 3 callers
Class
LearnableFourierPositionalEncoding
Learnable Fourier Feature Positional Encoding. Implements Algorithm 1 from "Learnable Fourier Features for Multi-Dimensional Spatial Pos
models/modules.py:461
↓ 3 callers
Class
SuperLinear
SuperLinear Layer: Implements Neuron-Level Models (NLMs) for the CTM. This layer is the core component enabling Neuron-Level Models (NLMs),
models/modules.py:146
↓ 2 callers
Class
ClassicControlBackbone
models/modules.py:372
↓ 2 callers
Class
CustomRotationalEmbedding
Custom Rotational Positional Embedding. Generates 2D positional embeddings based on rotating a fixed start vector. The rotation angle fo
models/modules.py:587
↓ 2 callers
Class
CustomRotationalEmbedding1D
models/modules.py:667
↓ 2 callers
Class
FastRandomDistributedSampler
r""" A distributed sampler that continuously yields random indices with replacement, avoiding frequent iterator recreation overhead for DataLo
utils/samplers.py:8
↓ 2 callers
Class
MNISTBackbone
Simple backbone for MNIST feature extraction.
models/modules.py:315
↓ 2 callers
Class
MiniGridBackbone
models/modules.py:336
↓ 2 callers
Class
MultiLearnableFourierPositionalEncoding
Combines multiple LearnableFourierPositionalEncoding modules with different initialization scales (gamma) via a learnable weighted sum.
models/modules.py:533
↓ 2 callers
Class
ParityBackbone
models/modules.py:241
↓ 2 callers
Class
QAMNISTDataset
A QAMNIST dataset that includes plus and minus operations on MNIST digits.
data/custom_datasets.py:21
↓ 2 callers
Class
QAMNISTIndexEmbeddings
models/modules.py:262
↓ 2 callers
Class
QAMNISTOperatorEmbeddings
models/modules.py:253
↓ 2 callers
Class
ShallowWide
Simple, wide, shallow convolutional backbone for image feature extraction. Alternative to ResNet, uses grouped convolutions and GLU activati
models/modules.py:389
↓ 2 callers
Class
SortDataset
data/custom_datasets.py:10
↓ 2 callers
Class
SynapseUNET
UNET-style architecture for the Synapse Model (f_theta1 in the paper). This module implements the connections between neurons in the CTM's l
models/modules.py:45
↓ 1 callers
Class
ContinuousThoughtMachineRL
models/ctm_rl.py:10
↓ 1 callers
Class
ContinuousThoughtMachineSORT
Slight adaption of the CTM to work with the sort task.
models/ctm_sort.py:5
↓ 1 callers
Class
LSTMBaseline
LSTM Baseline Args: iterations (int): Number of internal 'thought' steps (T, in paper). d_model (int): Core dimensionality o
models/lstm_qamnist.py:11
↓ 1 callers
Class
LSTMBaseline
LSTM Baseline Args: iterations (int): Number of internal 'thought' steps (T, in paper). d_model (int): Core dimensionality
models/lstm_rl.py:12
↓ 1 callers
Class
MaskVelocityWrapper
Simple wrapper that automatically resets the environment on done. Modeled after EpisodicLifeEnv but simplified since we don't need to han
tasks/rl/envs.py:4
↓ 1 callers
Class
ResNet
models/resnet.py:141
↓ 1 callers
Class
ThoughtSteps
Helper class for managing "thought steps" in the ctm_qamnist pipeline. Args: iterations_per_digit (int): Number of iterations for ea
models/modules.py:280
Class
BasicBlock
models/resnet.py:35
Class
Bottleneck
models/resnet.py:84
Class
ModularEquationHighlight
tasks/qamnist/analysis/make_blog_gifs_equation_animation.py:6
Class
PretrainedResNetWrapper
Wrapper to use standard pre-trained ResNet models from torchvision. Loads a specified ResNet architecture pre-trained on ImageNet, removes t
models/modules.py:412