Skip to content

Commit 2dd9368

Browse files
committed
feat(model/model): add method for easily copying models
1 parent 7cd31ae commit 2dd9368

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

boiling_learning/model/model.py

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def count_parameters(self, *, trainable: bool = True, non_trainable: bool = True
6666
def evaluate(self, data: tf.data.Dataset) -> Evaluation:
6767
return self.model.evaluate(data, return_dict=True)
6868

69+
def clone(self) -> ModelArchitecture:
70+
return ModelArchitecture(tf.keras.models.clone_model(self.model))
71+
6972

7073
@serialize.instance(ModelArchitecture)
7174
def _serialize_model(instance: ModelArchitecture, path: Path) -> None:

0 commit comments

Comments
 (0)