前馈兴奋

Neurocean大约 3 分钟example

信息从一个神经区域传递向另一个神经区域是通过在兴奋神经元之间的多个连接进行前馈兴奋来进行的。 神经元通常会接受多个突触前神经元搭档的输入(收敛性兴奋),并通过轴突分支输出到多个突触后神经元搭档(发散性兴奋)。 收敛性兴奋使得突触后神经元选择性地对突触前神经元的的特征作出反应。如果多个输入神经元携带相同的信号且具有不相干的噪声, 收敛性兴奋也可以很好地提高信噪比。发散性兴奋使得同一个信号号可以被不同的下游通路处理。

一个最典型的前馈兴奋的例子是灵长目动物的视觉系统,信号流从光感受器->双极细胞->视网膜神经节细胞(RGC)->外膝核(LGN)->初级视觉第4层->更高级的皮层区域。

简要拓扑图

前馈兴奋
前馈兴奋

代码示例

#
#   Copyright (c) 2022 Neurocean Group
#   All rights reserved.
#   Created by damone
#

import numpy as np

import ocean
from ocean import Session, CompileOption
from matplotlib import pyplot as plt
from ocean.utils.VisualizeHelper import visualizeHelper


def randomInput(number, timezone):
    return np.random.randint(2, size=(timezone, number), dtype=np.int8)


def visualizeResults(session, hidden1, hidden2, output):
    plt.figure()
    # Hidden1
    plt.subplot(3, 1, 1)
    plt.title("Hidden1 potentials")
    captures = session.getCaptures(
        hidden1, ["potentials", "output", "firePotentials"])
    visualizeHelper.plotPotentials(captures, [0])
    # Hidden2
    plt.subplot(3, 1, 2)
    plt.title("Hidden2 potentials")
    captures = session.getCaptures(
        hidden2, ["potentials", "output", "firePotentials"])
    visualizeHelper.plotPotentials(captures, [0])
    # output
    plt.subplot(3, 1, 3)
    plt.title("Output potentials")
    captures = session.getCaptures(
        output, ["potentials", "output", "firePotentials"])
    visualizeHelper.plotPotentials(captures, [0, 1, 2])
    plt.show()


def FeedForwardExcitation():
    # Session
    session = Session("session")

    # Make input group
    input = session.makeNeuronGroup(
        "SequenceInput",
        number=3,
        totalTime=512,
        inputBuffer=randomInput(3, 512)
    )

    # Make hidden1 group
    hidden1 = session.makeNeuronGroup(
        "General",
        number=1,
        thresholds=-25,
        restingPotentials=-70,
        decays=0.8,
        potentials=-70
    )

    # Make hidden2 group
    hidden2 = session.makeNeuronGroup(
        "General",
        number=1,
        thresholds=-25,
        restingPotentials=-70,
        decays=0.8,
        potentials=-70
    )

    # Make output group
    output = session.makeNeuronGroup(
        "General",
        number=3,
        thresholds=-25,
        restingPotentials=-70,
        decays=0.1,
        potentials=(2, -70, -30, 1)
    )

    # Make edge1
    edge1 = session.makeSynapseGroup(
        "SimpleSynapse",
        inputNumber=3,
        outputNumber=1,
        weights=6
    )
    input.output("output").connect(edge1.input("input"))
    edge1.output("output").connect(hidden1.input("input"))
    edge1.connect()

    # Make edge2
    edge2 = session.makeSynapseGroup(
        "SimpleSynapse",
        inputNumber=1,
        outputNumber=1,
        weights=18
    )
    hidden1.output("output").connect(edge2.input("input"))
    edge2.output("output").connect(hidden2.input("input"))
    edge2.connect()

    # Make edge3
    edge3 = session.makeSynapseGroup(
        "SimpleSynapse",
        inputNumber=1,
        outputNumber=3,
        weights=6
    )
    hidden2.output("output").connect(edge3.input("input"))
    edge3.output("output").connect(output.input("input"))
    edge3.connect()

    # Add monitor
    POTENTIALS = ["potentials", "output", "firePotentials"]
    session.addMonitors(hidden1, POTENTIALS)
    session.addMonitors(hidden2, POTENTIALS)
    session.addMonitors(output, POTENTIALS)

    # Run model
    option = ocean.RunOption(False, False, 512)
    if not (session.run(CompileOption.cpu(), option)):
        print("Run Model failed")
        return

    # Get captures, visualize it
    visualizeResults(session, hidden1, hidden2, output)


if __name__ == "__main__":
    FeedForwardExcitation()    

电位变化图

前馈兴奋
前馈兴奋
上次编辑于:
贡献者: damone