netlite 1.0.2__tar.gz → 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {netlite-1.0.2 → netlite-1.0.3}/PKG-INFO +1 -1
  2. {netlite-1.0.2 → netlite-1.0.3}/package_upload.py +1 -1
  3. {netlite-1.0.2 → netlite-1.0.3}/pyproject.toml +1 -1
  4. {netlite-1.0.2 → netlite-1.0.3}/src/netlite/neural_network.py +1 -1
  5. netlite-1.0.3/tests/test_neural_network.py +30 -0
  6. {netlite-1.0.2 → netlite-1.0.3}/.gitignore +0 -0
  7. {netlite-1.0.2 → netlite-1.0.3}/LICENSE +0 -0
  8. {netlite-1.0.2 → netlite-1.0.3}/README.md +0 -0
  9. {netlite-1.0.2 → netlite-1.0.3}/examples/netlite_example_fit_regression_line.py +0 -0
  10. {netlite-1.0.2 → netlite-1.0.3}/examples/netlite_example_lenet_cifar10.py +0 -0
  11. {netlite-1.0.2 → netlite-1.0.3}/examples/netlite_example_lenet_mnist.py +0 -0
  12. {netlite-1.0.2 → netlite-1.0.3}/examples/netlite_example_xor_classifier.py +0 -0
  13. {netlite-1.0.2 → netlite-1.0.3}/images/lenet_mnist_acc_curves.svg +0 -0
  14. {netlite-1.0.2 → netlite-1.0.3}/images/logo_netlite.png +0 -0
  15. {netlite-1.0.2 → netlite-1.0.3}/package_build.py +0 -0
  16. {netlite-1.0.2 → netlite-1.0.3}/package_run_tests.py +0 -0
  17. {netlite-1.0.2 → netlite-1.0.3}/requirements.txt +0 -0
  18. {netlite-1.0.2 → netlite-1.0.3}/src/netlite/__init__.py +0 -0
  19. {netlite-1.0.2 → netlite-1.0.3}/src/netlite/dataloader_cifar10.py +0 -0
  20. {netlite-1.0.2 → netlite-1.0.3}/src/netlite/dataloader_mnist.py +0 -0
  21. {netlite-1.0.2 → netlite-1.0.3}/src/netlite/layers.py +0 -0
  22. {netlite-1.0.2 → netlite-1.0.3}/src/netlite/loss_functions.py +0 -0
  23. {netlite-1.0.2 → netlite-1.0.3}/src/netlite/numba_optional.py +0 -0
  24. {netlite-1.0.2 → netlite-1.0.3}/src/netlite/optimizer.py +0 -0
  25. {netlite-1.0.2 → netlite-1.0.3}/tests/test_convolution.py +0 -0
  26. /netlite-1.0.2/tests/test_netlite.py → /netlite-1.0.3/tests/test_example_models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netlite
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: A small white-box training framework for neural networks for education.
5
5
  Project-URL: Homepage, https://github.com/haho12/netlite
6
6
  Project-URL: Issues, https://github.com/haho12/netlite/issues
@@ -74,4 +74,4 @@ success = git_tag_and_push()
74
74
  if not success:
75
75
  sys.exit()
76
76
 
77
- #subprocess.run(['twine', 'upload', 'dist/*'])
77
+ subprocess.run(['twine', 'upload', 'dist/*'])
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "netlite"
7
- version = "1.0.2"
7
+ version = "1.0.3"
8
8
  authors = [
9
9
  { name="Hanno Homann", email="hanno.homann@example.com" },
10
10
  ]
@@ -62,4 +62,4 @@ class NeuralNetwork():
62
62
  weights = layer.get_weights()
63
63
  for key in weights:
64
64
  assert key in loaded_params[i].keys(), f'Error: Key {key} no found in layer {i} of file {filename}.'
65
- weights[key] = loaded_params[i][key]
65
+ weights[key][:] = loaded_params[i][key]
@@ -0,0 +1,30 @@
1
+ # add parent folder with netlite source to path
2
+ import os
3
+ import sys
4
+ parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src'))
5
+ sys.path.insert(0, parent_dir)
6
+
7
+ import netlite as nl
8
+
9
+ def test_save_and_load():
10
+ model = nl.NeuralNetwork([
11
+ nl.FullyConnectedLayer(n_inputs=1, n_outputs=1),
12
+ ])
13
+
14
+ const1 = 3.
15
+ const2 = 4.
16
+ model.layers[0].weights[0,0] = const1
17
+ model.layers[0].bias[0] = const2
18
+
19
+ filename = 'pytest_params.npy'
20
+ model.save(filename)
21
+
22
+ model2 = nl.NeuralNetwork([
23
+ nl.FullyConnectedLayer(n_inputs=1, n_outputs=1),
24
+ ])
25
+ model2.load(filename)
26
+ os.remove(filename)
27
+
28
+ assert model2.layers[0].weights[0,0] == const1
29
+ assert model2.layers[0].bias[0] == const2
30
+
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes