Skip to content

Latest commit

 

History

History
110 lines (82 loc) · 2.04 KB

File metadata and controls

110 lines (82 loc) · 2.04 KB

API Reference

hodgkinhuxley.py

HodgkinHuxleyNeuron

Constructor key parameters:

  • C_m, g_Na, g_K, g_L
  • E_Na, E_K, E_L
  • V initial membrane voltage
  • spike_threshold_mv
  • drive (float or Callable[[float], float])

Methods:

  • set_drive(drive) -> None
  • get_drive(t_ms) -> float
  • reset(V0=-65.0, drive=None) -> None
  • step(dt_ms, t_ms, synaptic_current=0.0) -> bool

connection.py

Synapse

Fields:

  • pre, post
  • weight
  • tau_ms
  • delay_steps

Methods:

  • current() -> float
  • advance(dt_ms, pre_spike) -> None

NeuralNetwork

Methods:

  • add_neuron(name, neuron) -> None
  • connect(pre, post, weight=5.0, tau_ms=3.0, delay_steps=0) -> Synapse
  • reset(V0=-65.0) -> None
  • step(dt_ms, t_ms) -> Dict[str, bool]
  • run(t_end_ms, dt_ms=0.01) -> Dict[str, List[float]]
  • iter_connections() -> Iterable[Tuple[str, str, float]]

Run output keys:

  • t
  • V_<neuron_name>
  • spike_<neuron_name>

nand_architectures.py

NandFabric

Methods:

  • reset_count() -> None
  • nand(a, b) -> Bit
  • not_(a) -> Bit
  • and_(a, b) -> Bit
  • or_(a, b) -> Bit
  • xor(a, b) -> Bit
  • xnor(a, b) -> Bit
  • nor(a, b) -> Bit

Properties:

  • gate_count

NandBinaryAdder

Fields:

  • width
  • fabric

Methods:

  • half_adder(a, b) -> Tuple[Bit, Bit]
  • full_adder(a, b, cin) -> Tuple[Bit, Bit]
  • add_bits(a_bits_lsb, b_bits_lsb, cin=0) -> Tuple[List[Bit], Bit]
  • add_ints(a, b, cin=0) -> Dict[str, int]

NandComparator

Fields:

  • width
  • fabric

Methods:

  • compare_bits(a_bits_lsb, b_bits_lsb) -> Dict[str, Bit]
  • compare_ints(a, b) -> Dict[str, int]

NandALU

Fields:

  • width
  • fabric

Methods:

  • execute(a, b, cin=0) -> Dict[str, int]

Utility:

  • int_to_bits(value, width) -> List[Bit]
  • bits_to_int(bits_lsb) -> int

main.py CLI

python main.py [--mode {all,hh,nand}] [--no-show] [--save-prefix PREFIX]

Arguments:

  • --mode: choose demo family
  • --no-show: suppress interactive plot windows
  • --save-prefix: save generated figures to files