Skip to content

Ensembles

Multi-model ensemble coordination for SNN networks.

  • EnsembleOrchestrator — Coordinate multiple SNN models in parallel, aggregate outputs via voting, averaging, or stacking. Supports heterogeneous architectures (different neuron models, topologies).
Python
from sc_neurocore.ensembles import EnsembleOrchestrator

sc_neurocore.ensembles

sc_neurocore.ensembles -- Tier: research (experimental / research).

EnsembleOrchestrator dataclass

Manages a collective of SC-NeuroCore Agents. Implements ensemble consensus and coordinated action.

Source code in src/sc_neurocore/ensembles/orchestrator.py
Python
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@dataclass
class EnsembleOrchestrator:
    """
    Manages a collective of SC-NeuroCore Agents.
    Implements ensemble consensus and coordinated action.
    """

    agents: Dict[str, CognitiveOrchestrator] = field(default_factory=dict)

    def add_agent(self, name: str, agent: CognitiveOrchestrator) -> None:
        self.agents[name] = agent

    def run_consensus(self, pipeline: List[str], initial_input: Any) -> np.ndarray[Any, Any]:
        """
        Runs the same pipeline on all agents and averages results.
        """
        results = []
        for name, agent in self.agents.items():
            out = agent.execute_pipeline(pipeline, initial_input)
            results.append(out.to_prob())

        # Majority vote / Average
        return np.mean(results, axis=0)

    def coordinated_mission(self, goal: str) -> None:
        """
        Assigns sub-tasks to agents based on their capabilities.
        """
        logger.info("Ensemble: Initiating mission '%s'...", goal)
        for name, agent in self.agents.items():
            logger.info("  Agent '%s': Assigned sub-task.", name)
            agent.active_goals = [f"{goal}_subtask"]

run_consensus(pipeline, initial_input)

Runs the same pipeline on all agents and averages results.

Source code in src/sc_neurocore/ensembles/orchestrator.py
Python
34
35
36
37
38
39
40
41
42
43
44
def run_consensus(self, pipeline: List[str], initial_input: Any) -> np.ndarray[Any, Any]:
    """
    Runs the same pipeline on all agents and averages results.
    """
    results = []
    for name, agent in self.agents.items():
        out = agent.execute_pipeline(pipeline, initial_input)
        results.append(out.to_prob())

    # Majority vote / Average
    return np.mean(results, axis=0)

coordinated_mission(goal)

Assigns sub-tasks to agents based on their capabilities.

Source code in src/sc_neurocore/ensembles/orchestrator.py
Python
46
47
48
49
50
51
52
53
def coordinated_mission(self, goal: str) -> None:
    """
    Assigns sub-tasks to agents based on their capabilities.
    """
    logger.info("Ensemble: Initiating mission '%s'...", goal)
    for name, agent in self.agents.items():
        logger.info("  Agent '%s': Assigned sub-task.", name)
        agent.active_goals = [f"{goal}_subtask"]