scripts.nn#

Functions#

build_model(input_dim, num_classes)

Helper function to build a fresh model.

calculate_threshold(uncertainties, y_pred_classes, ...)

Returns the threshold that gives the best accuracy, not a quantile but the actual threshold.

predict_validation(model, X_val_bf, y_val_bf, ...)

Predicts the species of the test data.

prepare_for_training([TrainPanel])

save_train_stats(model, X_val_bf, y_val_bf, ...[, ...])

train_neural_network([TrainPanel])

train_wrapper(model, X_train, y_train, y_train_int, ...)

Helper function to train the model and return validation accuracy.

Module Contents#

scripts.nn.build_model(input_dim, num_classes)#

Helper function to build a fresh model.

scripts.nn.calculate_threshold(uncertainties, y_pred_classes, y_true_classes, species_names)#

Returns the threshold that gives the best accuracy, not a quantile but the actual threshold. Thus, its value can be higher than 1.0.

scripts.nn.predict_validation(model, X_val_bf, y_val_bf, species_names)#

Predicts the species of the test data.

scripts.nn.prepare_for_training(TrainPanel=None, **kwargs)#
scripts.nn.save_train_stats(model, X_val_bf, y_val_bf, species_names, model_dir, best_accuracy, fold_count, best_fold=None)#
scripts.nn.train_neural_network(TrainPanel=None, **kwargs)#
scripts.nn.train_wrapper(model, X_train, y_train, y_train_int, X_val, y_val, epochs, batch_size, patience)#

Helper function to train the model and return validation accuracy.