MCPcopy Create free account
hub / github.com/BindsNET/bindsnet / __init__

Method __init__

bindsnet/network/network.py:86–117  ·  view source on GitHub ↗

Initializes network object. :param dt: Simulation timestep. :param batch_size: Mini-batch size. :param learning: Whether to allow connection updates. True by default. :param reward_fn: Optional class allowing for modification of reward in case of

(
        self,
        dt: float = 1.0,
        batch_size: int = 1,
        learning: bool = True,
        reward_fn: Optional[Type[AbstractReward]] = None,
    )

Source from the content-addressed store, hash-verified

84 """
85
86 def __init__(
87 self,
88 dt: float = 1.0,
89 batch_size: int = 1,
90 learning: bool = True,
91 reward_fn: Optional[Type[AbstractReward]] = None,
92 ) -> None:
93 # language=rst
94 """
95 Initializes network object.
96
97 :param dt: Simulation timestep.
98 :param batch_size: Mini-batch size.
99 :param learning: Whether to allow connection updates. True by default.
100 :param reward_fn: Optional class allowing for modification of reward in case of
101 reward-modulated learning.
102 """
103 super().__init__()
104
105 self.dt = dt
106 self.batch_size = batch_size
107
108 self.layers = {}
109 self.connections = {}
110 self.monitors = {}
111
112 self.train(learning)
113
114 if reward_fn is not None:
115 self.reward_fn = reward_fn()
116 else:
117 self.reward_fn = None
118
119 def add_layer(self, layer: Nodes, name: str) -> None:
120 # language=rst

Callers

nothing calls this directly

Calls 1

trainMethod · 0.95

Tested by

no test coverage detected