chemicalchecker.tool.siamese.siamese_triplets.SiameseTriplets
- class SiameseTriplets(model_dir, evaluate=False, predict_only=False, plot=True, save_params=True, generator=None, **kwargs)[source]
Bases:
object
Siamese class.
This class implements a simple siamese neural network based on Keras that allows metric learning.
Initialize the Siamese class.
- Parameters:
model_dir (str) – Directorty where models will be stored.
traintest_file (str) – Path to the traintest file.
evaluate (bool) – Whether to run evaluation.
Methods
Compile Keras model
find_lr
Fit the model.
Do predictions.
- build_model(input_shape, load=False, cp=None)[source]
Compile Keras model
input_shape(tuple): X dimensions (only nr feat is needed) load(bool): Whether to load the pretrained model.