Skip to content

Commit

Permalink
Update dynamic_nn.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jteijema committed Feb 15, 2024
1 parent f39f38d commit aedaeb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions asreviewcontrib/models/dynamic_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def fit(self, X, y):
if X.shape[1] > max_features:
raise ValueError(f"Feature size too large: {X.shape[1]} features. Maximum allowed is {max_features}.")

print("\nNumber of features:", X.shape[1])
if self.verbose == 1:
print("\nNumber of features:", X.shape[1])
# Determine the number of layers based on the number of rows
num_layers = ceil(log10(max(10, X.shape[0])))

Expand All @@ -53,7 +54,8 @@ def fit(self, X, y):
min_delta=self.min_delta,
restore_best_weights=True)

print(f"\nFitting New Iteration with {num_layers} layers:\n")
if self.verbose == 1:
print(f"\nFitting New Iteration with {num_layers} layers:\n")
self._model.fit(X, y, epochs=100, batch_size=32,
shuffle=True, callbacks=[callback])

Expand Down

0 comments on commit aedaeb2

Please sign in to comment.