Stop passing component initializers as hparams
Pass the component initializer as an hparam slows down the script very much. The API has now been changed to pass it as a kwarg to the models instead. The example scripts have also been updated to reflect the new changes. Also, ImageGMLVQ and an example script `gmlvq_mnist.py` that uses it have also been added.
This commit is contained in:
@@ -29,14 +29,15 @@ if __name__ == "__main__":
|
||||
prototypes_per_class = 20
|
||||
hparams = dict(
|
||||
distribution=(nclasses, prototypes_per_class),
|
||||
prototype_initializer=pt.components.SSI(train_ds, noise=1e-1),
|
||||
transfer_function="sigmoid_beta",
|
||||
transfer_beta=10.0,
|
||||
lr=0.01,
|
||||
)
|
||||
|
||||
# Initialize the model
|
||||
model = pt.models.GLVQ(hparams)
|
||||
model = pt.models.GLVQ(hparams,
|
||||
prototype_initializer=pt.components.SSI(train_ds,
|
||||
noise=1e-1))
|
||||
|
||||
# Callbacks
|
||||
vis = pt.models.VisGLVQ2D(train_ds, show_last_only=True, block=True)
|
||||
|
Reference in New Issue
Block a user