Skip to main content

Crate pc_rl_core

Crate pc_rl_core 

Source
Expand description

Predictive Coding Actor-Critic framework.

A publishable reinforcement learning library implementing a novel architecture where the actor uses iterative top-down/bottom-up predictive coding inference loops instead of standard feedforward passes, combined with a standard MLP critic for value estimation.

§Key Components

  • PcActor — Predictive coding network with variable hidden topology, iterative inference loop, and surprise scoring.
  • MlpCritic — Standard MLP value function with MSE loss backpropagation.
  • PcActorCritic — Integrated agent: act, learn (episodic/continuous), surprise-based scheduling, save/load.
  • serializer — JSON weight persistence with checkpointing support.

Re-exports§

pub use activation::Activation;
pub use error::PcError;
pub use layer::Layer;
pub use layer::LayerDef;
pub use linalg::cpu::CpuLinAlg;
pub use linalg::golub_kahan::GolubKahanSvd;
pub use linalg::golub_kahan::SvdError;
pub use linalg::LinAlg;
pub use matrix::argmax_masked;
pub use matrix::cca_neuron_alignment;
pub use matrix::rms_error;
pub use matrix::sample_from_probs;
pub use matrix::softmax_masked;
pub use matrix::Matrix;
pub use matrix::GRAD_CLIP;
pub use matrix::WEIGHT_CLIP;
pub use mlp_critic::MlpCritic;
pub use mlp_critic::MlpCriticConfig;
pub use mlp_critic::MlpCriticWeights;
pub use pc_actor::InferResult;
pub use pc_actor::PcActor;
pub use pc_actor::PcActorConfig;
pub use pc_actor::SelectionMode;
pub use pc_actor_critic::ActivationCache;
pub use pc_actor_critic::PcActorCritic;
pub use pc_actor_critic::PcActorCriticConfig;
pub use pc_actor_critic::TrajectoryStep;
pub use serializer::checkpoint_filename;
pub use serializer::load_agent;
pub use serializer::load_agent_generic;
pub use serializer::save_agent;
pub use serializer::save_checkpoint;
pub use serializer::AgentMetadata;
pub use serializer::PcActorWeights;
pub use serializer::SaveFile;
pub use serializer::TrainingMetrics;

Modules§

activation
Activation functions for neural network layers.
error
Crate-wide error type for pc_rl_core.
layer
Dense neural network layer.
linalg
Linear algebra trait abstraction for backend-agnostic compute.
matrix
Dense matrix operations and vector utilities for neural networks.
mlp_critic
Standard MLP critic (value function) for the PC Actor-Critic agent.
pc_actor
Predictive Coding Actor Network.
pc_actor_critic
Integrated PC Actor-Critic agent.
serializer
JSON-based weight persistence for the PC-Actor-Critic agent.

Type Aliases§

LayerCpu
Type alias: CPU-backed layer.
MlpCriticCpu
Type alias: CPU-backed MLP critic.
PcActorCpu
Type alias: CPU-backed PC actor.
PcActorCriticCpu
Type alias: CPU-backed PC actor-critic agent.