(self, X, pretrain_epochs=1)
| 29 | count += 1 |
| 30 | |
| 31 | def fit(self, X, pretrain_epochs=1): |
| 32 | self.D = X.shape[1] # save for later |
| 33 | |
| 34 | current_input = X |
| 35 | for ae in self.hidden_layers: |
| 36 | ae.fit(current_input, epochs=pretrain_epochs) |
| 37 | |
| 38 | # create current_input for the next layer |
| 39 | current_input = ae.hidden_op(current_input) |
| 40 | |
| 41 | # return it here so we can use directly after fitting without calling forward |
| 42 | return current_input |
| 43 | |
| 44 | def forward(self, X): |
| 45 | Z = X |