Skip to content

Commit 5d4e332

Browse files
committed
Move quantizer defaults to model factory
1 parent 229fae7 commit 5d4e332

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

larq_zoo/core/model_factory.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
class ModelFactory:
1313
"""A base class for Larq Zoo models. Defines some common fields."""
1414

15+
input_quantizer = None
16+
kernel_quantizer = None
17+
kernel_constraint = None
18+
1519
# This field is included for automatic inference of `num_clases`, if no
1620
# value is otherwise provided. We set `allow_missing` because we don't want
1721
# to throw an error if a dataset is not provided, as long as `num_classes`

larq_zoo/training/knowledge_distillation/knowledge_distillation.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,6 @@ class TeacherStudentModelFactory(ModelFactory):
296296
teacher_model: tf.keras.models.Model = ComponentField(allow_missing=True)
297297
student_model: tf.keras.models.Model = ComponentField()
298298

299-
input_quantizer = None
300-
kernel_quantizer = None
301-
kernel_constraint = None
302-
303299
# Must be set if there is a teacher and allow_missing teacher weights is not True.
304300
# Either a full path or the name of a network (in which case it will be sought in the current `model_dir`).
305301
initialize_teacher_weights_from: str = Field(allow_missing=True)

0 commit comments

Comments
 (0)