(self, inx)
| 43 | setattr(self, f"lin{l}", lin) |
| 44 | |
| 45 | def forward(self, inx): |
| 46 | x = inx |
| 47 | for l in range(self.num_layers - 1): |
| 48 | lin = getattr(self, f"lin{l}") |
| 49 | x = lin(x) |
| 50 | if l == self.num_layers - 2: |
| 51 | if self.last_act_fun is not None: |
| 52 | x = self.last_act_fun(x) |
| 53 | else: |
| 54 | x = self.act_fun(x) |
| 55 | return x |