Skip to content

Latest commit

 

History

History
197 lines (120 loc) · 5.06 KB

File metadata and controls

197 lines (120 loc) · 5.06 KB
layout default
title I - CST Core
subtitle

I - CST Core

Session Overview

  • CST builds cognitive architectures with small concurrent units called codelets and object memories.
  • BabyBench is a Multimodal Benchmark of Infant Behaviors for Developmental Artificial Intelligence.
  • In this session you will build a minimal CST pipeline:

Sensor → Processing → Actuator

The pipeline will:

  1. Read a value from BabyBench.
  2. Derive an observation.
  3. Send back an action.

Core Concepts

Mind

The class that holds codelets and MemoryObjects (MOs), and schedules execution.

Codelet

A small, periodic computation unit that runs its proc() method.

MemoryObject (MO)

A shared data structure used to pass information between codelets.

Inputs/Outputs

Each codelet declares which MOs it reads and writes.

proc

Each codelet has a time step (e.g., 200 ms) that controls how often it runs.


Example CST Pipeline

  • Sensory Codelet:

    • Requests a reading from BabyBench.
    • Writes an integer to INPUT (MO).
  • Processing Codelet:

    • Reads SENSOR_DATA.
    • Applies a simple rule.
    • Writes a boolean to PROCESSED_DATA (MO).
  • Actuator Codelet:

    • Reads PROCESSED_DATA.
    • Maps it to an action string.
    • Writes the last action to ACTION (MO).
    • Sends the action to BabyBench.

The Mind keeps all three running in a loop, creating a continuous perception–action cycle.


Codelet Lifecycle

  1. accessMemoryObjects()
    Get references to required MOs.

  2. calculateActivation()
    Decide if the codelet should run.

    • In this exercise: return 1.0 (always run).
  3. proc()
    Contains the logic:

    • Sensor: socket I/O → INPUT.
    • Processing: compute observation → PROCESSING.
    • Actuator: choose action → send over socket → OUTPUT.
  4. setTimeStep(ms)
    Controls how often each codelet executes.

    • Start with 200 ms for all.

Implementation Steps

1. ExperimentMain

  • Open a socket:
    Socket("localhost", 5000)
  • Send a one-line "READY".

2. SimpleMind

  • Create the three MemoryObjects.

  • Connect each codelet’s inputs/outputs to them.

3. SensorCodelet

  • Send SENSE.

  • Read a line, convert to int.

  • Store new ValueHolder(int) in INPUT.

4. ProcessingCodelet

  • Read ValueHolder.

  • Compute boolean (e.g., value > 10).

  • Store in PROCESSING.

5. ActuatorCodelet

  • Read boolean from PROCESSING.

  • Map:

  • true → "PUSH"

  • false → "IDLE"

  • Send ACT:.

  • Store action in OUTPUT.

Success Criteria ✅

  • Java connects to Python and prints a “connected/ready” message.

  • SENSOR_DATA updates over time with integers from BabyBench.

  • OBS flips according to your rule (e.g., true when value > threshold).

  • ACTION records the last command, and BabyBench reacts when actions are sent.

  • Console shows a stable cycle: Sensor → Processing → Actuator (repeating without errors)

How to run?

1. Run script2.sh

  • Access VNC: "File System" > "sharevnc"
  • Open a terminal
  • Run script2.sh. It should start MIMo.

2. Build and run the java example

  • Access the folder of the project in java: 1_CSTCore/1_MIMoCoreModel
  • Open a terminal
  • To build:

javac -cp 'lib/*' -d build $(find src -name "*.java")

  • To run: java -cp "build:lib/*" cst_attmod_app.ExperimentMain

3. Analyze results

CST should start to run its codelets.

Sensor codelets should colect data from MIMo and write into memory.

Processing codelet should process memory objects.

Actuator codelet should sent an action based on processed memory.

Codelet Customization Challenges

Sensorial Codelet

  • Add confidence and timestamp to sensor readings: Give ValueHolder more semantics: include reading, confidence, and timestamp in a JSONObject.

  • Simulate noise and occasional dropouts: Allow parameters (noise, dropout probability) via constructor.

  • In SimpleMind, instantiate sensors with distinct parameters (even without changing the topology).

Processing Codelet

  • Apply a moving average filter to smooth sensor values and normalize readings into a 0–1 evidence scale. Convert value to a filtered evidence field — we also keep the composite confidence.

  • Introduce adaptive thresholds with hysteresis (stable labels).Produces a stable binary label (e.g., “HIGH”/“LOW”) from evidence.

  • Generate explainable outputs (logs + JSON with multiple fields) and explore how processed evidence changes actuator behavior.

Actuator Codelet

  • Use a confidence-weighted decision rule (evidence × confidence). Act only when processed confidence supports the decision.

  • Implement a refractory period to avoid chattering. Avoid repeating identical actions in short time windows.

  • Store structured action objects in memory (should_act, intensity, reason). Send dual outputs: internal memory + external channel (e.g., socket/log). Compare stable vs. unstable actuator behavior under noisy inputs.

Any questions or problems, please contact us: