Adds a connection between layers of nodes to the network. :param connection: An instance of class ``Connection``. :param source: Logical name of the connection's source layer. :param target: Logical name of the connection's target layer.
(
self, connection: AbstractConnection, source: str, target: str
)
| 132 | layer.set_batch_size(self.batch_size) |
| 133 | |
| 134 | def add_connection( |
| 135 | self, connection: AbstractConnection, source: str, target: str |
| 136 | ) -> None: |
| 137 | # language=rst |
| 138 | """ |
| 139 | Adds a connection between layers of nodes to the network. |
| 140 | |
| 141 | :param connection: An instance of class ``Connection``. |
| 142 | :param source: Logical name of the connection's source layer. |
| 143 | :param target: Logical name of the connection's target layer. |
| 144 | """ |
| 145 | self.connections[(source, target)] = connection |
| 146 | self.add_module(source + "_to_" + target, connection) |
| 147 | |
| 148 | connection.dt = self.dt |
| 149 | connection.train(self.learning) |
| 150 | |
| 151 | def add_monitor(self, monitor: AbstractMonitor, name: str) -> None: |
| 152 | # language=rst |