Skip to content

Commit

Permalink
fix(model/model): remove ModelArchitecture.__json_encode__
Browse files Browse the repository at this point in the history
  • Loading branch information
ruancomelli committed Sep 18, 2022
1 parent 3d8650f commit 71c129d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions boiling_learning/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ def from_config(cls, config: Dict[str, Any]) -> ModelArchitecture:
tf.keras.models.model_from_json(_json.dumps(config), custom_objects=_CUSTOM_OBJECTS)
)

def __json_encode__(self) -> Dict[str, Any]:
def __describe__(self) -> Dict[str, Any]:
model_json = _json.loads(self.model.to_json())
return anonymize_model_json(
{key: value for key, value in model_json['config'].items() if key != 'name'}
)

def __describe__(self) -> Dict[str, Any]:
return typing.cast(Dict[str, Any], json.encode(self))

def count_parameters(self, *, trainable: bool = True, non_trainable: bool = True) -> int:
if trainable and non_trainable:
return typing.cast(int, self.model.count_params())
Expand Down
1 change: 0 additions & 1 deletion boiling_learning/utils/table_dispatch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Any, Callable, Dict, Optional, TypeVar

_T = TypeVar('_T')
_Callable = TypeVar('_Callable', bound=Callable[..., Any])


Expand Down

0 comments on commit 71c129d

Please sign in to comment.