Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warnings from tests. Issue 264 #265

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mcfly/find_architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def train_models_on_samples(X_train, y_train, X_val, y_val, models,
or `(inputs, targets, sample_weights)`
- generator or `keras.utils.Sequence`. Should return a tuple of
`(inputs, targets)` or `(inputs, targets, sample_weights)`

The input dataset for validation of shape
(num_samples_val, num_timesteps, num_channels)
More details can be found in the documentation for the Keras
Expand Down Expand Up @@ -185,7 +185,7 @@ def train_models_on_samples(X_train, y_train, X_val, y_val, models,

if outputfile is not None:
store_train_hist_as_json(params, model_types, history.history,
outputfile, model.metrics_names[0])
outputfile)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed explicitly setting up metrics because it is deprecated

if model_path is not None:
model.save(os.path.join(model_path, 'model_{}.h5'.format(i)))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_integration(self):
number_of_classes=num_classes,
number_of_models=2,
metrics=[metric],
model_type='CNN') # Because CNNs are quick to train.
model_types=['CNN']) # Because CNNs are quick to train.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. "model_type" doesn't seem to be a valid parameter

histories, val_accuracies, val_losses = find_architecture.train_models_on_samples(X_train, y_train,
X_val, y_val,
models, nr_epochs=5,
Expand Down
5 changes: 4 additions & 1 deletion tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def create_dummy_model():
num_time_steps = 100
num_channels = 2
num_samples_train = 5
model, _parameters, _type = modelgen.generate_models((num_samples_train, num_time_steps, num_channels), 5, 1)[0]
model, _parameters, _type = modelgen.generate_models(
(num_samples_train, num_time_steps, num_channels), 5, 1,
['CNN'] # Chosen one model type to avoid warnings
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model type is irrelevant, it's just necessary that it is only one

)[0]
return model


Expand Down