侧向抑制

Neurocean大约 3 分钟案例案例

侧抑制是一种广泛存在的回路。它通过放大平行通路之间的活性差异来选择要传播到下游电路的信息。 例如,脊椎动物视网膜中的光感受器神经元激活水平细胞,水平细胞对附近的许多光感受器神经元提供反馈抑制。 这一行为是下游神经节细胞中经典的中央环绕感受野的主要贡献者,赋予这些神经元提取空间或颜色对比信息的能力。 横向抑制也被用于其他感觉系统,其一般目的是使下游电路处理的行为学相关信息的表征更加清晰。

简要拓扑图

前馈兴奋
前馈兴奋

代码示例

#
#   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, hidden, output):
    plt.figure()
    # Hidden1
    plt.subplot(2, 1, 1)
    plt.title("Hidden1 potentials")
    captures = session.getCaptures(
        hidden, ["potentials", "output", "firePotentials"])
    visualizeHelper.plotPotentials(captures, [0])

    # output
    plt.subplot(2, 1, 2)
    plt.title("Output potentials")
    captures = session.getCaptures(
        output, ["potentials", "output", "firePotentials"])
    visualizeHelper.plotPotentials(captures, [0, 1, 2])
    plt.show()


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

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

    # Make hidden group
    hidden = 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=-70
    )

    # Make output reduce
    outputReduce = session.makeModel(
        "Reduce",
        number=2
    )
    outputReduce.output("output").connect(output.input("input"))

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

    # Make edge2
    edge2 = session.makeSynapseGroup(
        "SimpleSynapse",
        inputNumber=3,
        outputNumber=3,
        weights=9
    )
    input.output("output").connect(edge2.input("input"))
    edge2.output("output").connect(outputReduce.input("input0"))
    edge2.connect(0, 0)
    edge2.connect(1, 1)
    edge2.connect(2, 2)

    # Make edge3
    edge3 = session.makeSynapseGroup(
        "SimpleSynapse",
        inputNumber=1,
        outputNumber=3,
        weights=-18
    )
    hidden.output("output").connect(edge3.input("input"))
    edge3.output("output").connect(outputReduce.input("input1"))
    edge3.connect()

    # Add monitor
    POTENTIALS = ["potentials", "output", "firePotentials"]
    session.addMonitors(hidden, 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, hidden, output)


if __name__ == "__main__":
    LateralInhibition()

电位变化图

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