Skip to content

Commit

Permalink
Merge pull request #40 from marcpinet/fix-layer-loading
Browse files Browse the repository at this point in the history
fix: new layers in config loading
  • Loading branch information
marcpinet authored May 17, 2024
2 parents bf1c510 + 490f34a commit 7b24e76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions neuralnetlib/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def from_config(config: dict) -> 'Layer':
return Conv2D.from_config(config)
elif config['name'] == 'MaxPooling2D':
return MaxPooling2D.from_config(config)
elif config['name'] == 'AveragePooling2D':
return AveragePooling2D.from_config(config)
elif config['name'] == 'Flatten':
return Flatten.from_config(config)
elif config['name'] == 'Dropout':
Expand All @@ -40,10 +42,14 @@ def from_config(config: dict) -> 'Layer':
return Conv1D.from_config(config)
elif config['name'] == 'MaxPooling1D':
return MaxPooling1D.from_config(config)
elif config['name'] == 'AveragePooling1D':
return AveragePooling1D.from_config(config)
elif config['name'] == 'Embedding':
return Embedding.from_config(config)
elif config['name'] == 'BatchNormalization':
return BatchNormalization.from_config(config)
elif config['name'] == 'Permute':
return Permute.from_config(config)
else:
raise ValueError(f'Invalid layer name: {config["name"]}')

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='neuralnetlib',
version='2.5.0',
version='2.5.1',
author='Marc Pinet',
description='A simple convolutional neural network library with only numpy as dependency',
long_description=open('README.md', encoding="utf-8").read(),
Expand Down

0 comments on commit 7b24e76

Please sign in to comment.