congrads 1.0.5__tar.gz → 1.0.7__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 (49) hide show
  1. {congrads-1.0.5 → congrads-1.0.7}/PKG-INFO +15 -1
  2. {congrads-1.0.5 → congrads-1.0.7}/README.md +14 -0
  3. {congrads-1.0.5 → congrads-1.0.7}/congrads/constraints.py +17 -30
  4. {congrads-1.0.5 → congrads-1.0.7}/congrads.egg-info/PKG-INFO +15 -1
  5. {congrads-1.0.5 → congrads-1.0.7}/docs/index.rst +29 -0
  6. {congrads-1.0.5 → congrads-1.0.7}/.gitignore +0 -0
  7. {congrads-1.0.5 → congrads-1.0.7}/.gitlab-ci.yml +0 -0
  8. {congrads-1.0.5 → congrads-1.0.7}/.pylintrc +0 -0
  9. {congrads-1.0.5 → congrads-1.0.7}/.readthedocs.yaml +0 -0
  10. {congrads-1.0.5 → congrads-1.0.7}/.vscode/extensions.json +0 -0
  11. {congrads-1.0.5 → congrads-1.0.7}/.vscode/settings.json +0 -0
  12. {congrads-1.0.5 → congrads-1.0.7}/LICENSE +0 -0
  13. {congrads-1.0.5 → congrads-1.0.7}/congrads/__init__.py +0 -0
  14. {congrads-1.0.5 → congrads-1.0.7}/congrads/checkpoints.py +0 -0
  15. {congrads-1.0.5 → congrads-1.0.7}/congrads/core.py +0 -0
  16. {congrads-1.0.5 → congrads-1.0.7}/congrads/datasets.py +0 -0
  17. {congrads-1.0.5 → congrads-1.0.7}/congrads/descriptor.py +0 -0
  18. {congrads-1.0.5 → congrads-1.0.7}/congrads/metrics.py +0 -0
  19. {congrads-1.0.5 → congrads-1.0.7}/congrads/networks.py +0 -0
  20. {congrads-1.0.5 → congrads-1.0.7}/congrads/transformations.py +0 -0
  21. {congrads-1.0.5 → congrads-1.0.7}/congrads/utils.py +0 -0
  22. {congrads-1.0.5 → congrads-1.0.7}/congrads.egg-info/SOURCES.txt +0 -0
  23. {congrads-1.0.5 → congrads-1.0.7}/congrads.egg-info/dependency_links.txt +0 -0
  24. {congrads-1.0.5 → congrads-1.0.7}/congrads.egg-info/requires.txt +0 -0
  25. {congrads-1.0.5 → congrads-1.0.7}/congrads.egg-info/top_level.txt +0 -0
  26. {congrads-1.0.5 → congrads-1.0.7}/docs/Makefile +0 -0
  27. {congrads-1.0.5 → congrads-1.0.7}/docs/_static/VanBaelen2023.bib +0 -0
  28. {congrads-1.0.5 → congrads-1.0.7}/docs/_static/congrads_export.png +0 -0
  29. {congrads-1.0.5 → congrads-1.0.7}/docs/_static/congrads_export.svg +0 -0
  30. {congrads-1.0.5 → congrads-1.0.7}/docs/_static/congrads_favicon.png +0 -0
  31. {congrads-1.0.5 → congrads-1.0.7}/docs/_static/congrads_favicon.svg +0 -0
  32. {congrads-1.0.5 → congrads-1.0.7}/docs/_static/convergence_illustration.gif +0 -0
  33. {congrads-1.0.5 → congrads-1.0.7}/docs/api.rst +0 -0
  34. {congrads-1.0.5 → congrads-1.0.7}/docs/concepts.rst +0 -0
  35. {congrads-1.0.5 → congrads-1.0.7}/docs/conf.py +0 -0
  36. {congrads-1.0.5 → congrads-1.0.7}/docs/make.bat +0 -0
  37. {congrads-1.0.5 → congrads-1.0.7}/docs/requirements.in +0 -0
  38. {congrads-1.0.5 → congrads-1.0.7}/docs/requirements.txt +0 -0
  39. {congrads-1.0.5 → congrads-1.0.7}/docs/start.rst +0 -0
  40. {congrads-1.0.5 → congrads-1.0.7}/examples/BiasCorrection.py +0 -0
  41. {congrads-1.0.5 → congrads-1.0.7}/examples/FamilyIncome.py +0 -0
  42. {congrads-1.0.5 → congrads-1.0.7}/examples/NoisySines.py +0 -0
  43. {congrads-1.0.5 → congrads-1.0.7}/notebooks/BiasCorrection.ipynb +0 -0
  44. {congrads-1.0.5 → congrads-1.0.7}/notebooks/FamilyIncome.ipynb +0 -0
  45. {congrads-1.0.5 → congrads-1.0.7}/pyproject.toml +0 -0
  46. {congrads-1.0.5 → congrads-1.0.7}/setup.cfg +0 -0
  47. {congrads-1.0.5 → congrads-1.0.7}/tests/congrads/test_utils.py +0 -0
  48. {congrads-1.0.5 → congrads-1.0.7}/tests/examples/test_BiasCorrection.py +0 -0
  49. {congrads-1.0.5 → congrads-1.0.7}/tests/examples/test_FamilyIncome.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: congrads
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: A toolbox for using Constraint Guided Gradient Descent when training neural networks.
5
5
  Author-email: Wout Rombouts <wout.rombouts@kuleuven.be>, Quinten Van Baelen <quinten.vanbaelen@kuleuven.be>, Peter Karsmakers <peter.karsmakers@kuleuven.be>
6
6
  License: Copyright 2024 DTAI - KU Leuven
@@ -203,6 +203,20 @@ We welcome contributions to Congrads! Whether you want to report issues, suggest
203
203
 
204
204
  Congrads is licensed under the [The 3-Clause BSD License](LICENSE). We encourage companies that are interested in a collaboration for a specific topic to contact the authors for more information or to set up joint research projects.
205
205
 
206
+ ## Contacts
207
+
208
+ Feel free to contact any of the below contact persons for more information or details about the project. Companies interested in a collaboration, or to set up joint research projects are also encouraged to get in touch with us.
209
+
210
+ - Peter Karsmakers [ [email](mailto:peter.karsmakers@kuleuven.be) | [website](https://www.kuleuven.be/wieiswie/en/person/00047893) ]
211
+ - Quinten Van Baelen [ [email](mailto:quinten.vanbaelen@kuleuven.be) | [website](https://www.kuleuven.be/wieiswie/en/person/00125540) ]
212
+
213
+ ## Contributors
214
+
215
+ Below you find a list of people who contributed in making the toolbox. Feel free to contact them for any repository- or code-specific questions, suggestions or remarks.
216
+
217
+ - Wout Rombouts [ [email](mailto:wout.rombouts@kuleuven.be) | [github profile](https://github.com/rombie18) ]
218
+ - Quinten Van Baelen [ [email](mailto:quinten.vanbaelen@kuleuven.be) | [github profile](https://github.com/quinten-vb) ]
219
+
206
220
  ---
207
221
 
208
222
  Elevate your neural networks with Congrads! 🚀
@@ -161,6 +161,20 @@ We welcome contributions to Congrads! Whether you want to report issues, suggest
161
161
 
162
162
  Congrads is licensed under the [The 3-Clause BSD License](LICENSE). We encourage companies that are interested in a collaboration for a specific topic to contact the authors for more information or to set up joint research projects.
163
163
 
164
+ ## Contacts
165
+
166
+ Feel free to contact any of the below contact persons for more information or details about the project. Companies interested in a collaboration, or to set up joint research projects are also encouraged to get in touch with us.
167
+
168
+ - Peter Karsmakers [ [email](mailto:peter.karsmakers@kuleuven.be) | [website](https://www.kuleuven.be/wieiswie/en/person/00047893) ]
169
+ - Quinten Van Baelen [ [email](mailto:quinten.vanbaelen@kuleuven.be) | [website](https://www.kuleuven.be/wieiswie/en/person/00125540) ]
170
+
171
+ ## Contributors
172
+
173
+ Below you find a list of people who contributed in making the toolbox. Feel free to contact them for any repository- or code-specific questions, suggestions or remarks.
174
+
175
+ - Wout Rombouts [ [email](mailto:wout.rombouts@kuleuven.be) | [github profile](https://github.com/rombie18) ]
176
+ - Quinten Van Baelen [ [email](mailto:quinten.vanbaelen@kuleuven.be) | [github profile](https://github.com/quinten-vb) ]
177
+
164
178
  ---
165
179
 
166
180
  Elevate your neural networks with Congrads! 🚀
@@ -94,8 +94,7 @@ class Constraint(ABC):
94
94
  defined in the `descriptor`.
95
95
 
96
96
  Note:
97
- - If `rescale_factor <= 1`, a warning is issued, and the value is
98
- adjusted to a positive value greater than 1.
97
+ - If `rescale_factor <= 1`, a warning is issued.
99
98
  - If `name` is not provided, a name is auto-generated,
100
99
  and a warning is logged.
101
100
 
@@ -120,7 +119,7 @@ class Constraint(ABC):
120
119
 
121
120
  # Type checking
122
121
  validate_iterable("neurons", neurons, str)
123
- validate_type("name", name, (str, type(None)))
122
+ validate_type("name", name, str, allow_none=True)
124
123
  validate_type("monitor_only", monitor_only, bool)
125
124
  validate_type("rescale_factor", rescale_factor, Number)
126
125
 
@@ -132,12 +131,13 @@ class Constraint(ABC):
132
131
  # Perform checks
133
132
  if rescale_factor <= 1:
134
133
  warnings.warn(
135
- "Rescale factor for constraint %s is <= 1. The network \
136
- will favor general loss over the constraint-adjusted loss. \
137
- Is this intended behavior? Normally, the loss should \
138
- always be larger than 1.",
139
- name,
134
+ f"Rescale factor for constraint {name} is <= 1. The network "
135
+ "will favor general loss over the constraint-adjusted loss. "
136
+ "Is this intended behavior? Normally, the rescale factor "
137
+ "should always be larger than 1.",
140
138
  )
139
+ else:
140
+ self.rescale_factor = rescale_factor
141
141
 
142
142
  # If no constraint_name is set, generate one based
143
143
  # on the class name and a random suffix
@@ -149,31 +149,18 @@ class Constraint(ABC):
149
149
  )
150
150
  self.name = f"{self.__class__.__name__}_{random_suffix}"
151
151
  warnings.warn(
152
- "Name for constraint is not set. Using %s.", self.name
153
- )
154
-
155
- # If rescale factor is not larger than 1, warn user and adjust
156
- if rescale_factor <= 1:
157
- self.rescale_factor = abs(rescale_factor) + 1.5
158
- warnings.warn(
159
- "Rescale factor for constraint %s is < 1, adjusted value \
160
- %s to %s.",
161
- name,
162
- rescale_factor,
163
- self.rescale_factor,
152
+ f"Name for constraint is not set. Using {self.name}.",
164
153
  )
165
- else:
166
- self.rescale_factor = rescale_factor
167
154
 
168
155
  # Infer layers from descriptor and neurons
169
156
  self.layers = set()
170
157
  for neuron in self.neurons:
171
158
  if neuron not in self.descriptor.neuron_to_layer.keys():
172
159
  raise ValueError(
173
- f'The neuron name {neuron} used with constraint \
174
- {self.name} is not defined in the descriptor. Please \
175
- add it to the correct layer using \
176
- descriptor.add("layer", ...).'
160
+ f"The neuron name {neuron} used with constraint "
161
+ f"{self.name} is not defined in the descriptor. Please "
162
+ "add it to the correct layer using "
163
+ "descriptor.add('layer', ...)."
177
164
  )
178
165
 
179
166
  self.layers.add(self.descriptor.neuron_to_layer[neuron])
@@ -675,13 +662,13 @@ class SumConstraint(Constraint):
675
662
  # weight list dimensions, raise error
676
663
  if weights_left and (len(neuron_names_left) != len(weights_left)):
677
664
  raise ValueError(
678
- "The dimensions of neuron_names_left don't match with the \
679
- dimensions of weights_left."
665
+ "The dimensions of neuron_names_left don't match with the "
666
+ "dimensions of weights_left."
680
667
  )
681
668
  if weights_right and (len(neuron_names_right) != len(weights_right)):
682
669
  raise ValueError(
683
- "The dimensions of neuron_names_right don't match with the \
684
- dimensions of weights_right."
670
+ "The dimensions of neuron_names_right don't match with the "
671
+ "dimensions of weights_right."
685
672
  )
686
673
 
687
674
  # If weights are provided for summation, transform them to Tensors
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: congrads
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: A toolbox for using Constraint Guided Gradient Descent when training neural networks.
5
5
  Author-email: Wout Rombouts <wout.rombouts@kuleuven.be>, Quinten Van Baelen <quinten.vanbaelen@kuleuven.be>, Peter Karsmakers <peter.karsmakers@kuleuven.be>
6
6
  License: Copyright 2024 DTAI - KU Leuven
@@ -203,6 +203,20 @@ We welcome contributions to Congrads! Whether you want to report issues, suggest
203
203
 
204
204
  Congrads is licensed under the [The 3-Clause BSD License](LICENSE). We encourage companies that are interested in a collaboration for a specific topic to contact the authors for more information or to set up joint research projects.
205
205
 
206
+ ## Contacts
207
+
208
+ Feel free to contact any of the below contact persons for more information or details about the project. Companies interested in a collaboration, or to set up joint research projects are also encouraged to get in touch with us.
209
+
210
+ - Peter Karsmakers [ [email](mailto:peter.karsmakers@kuleuven.be) | [website](https://www.kuleuven.be/wieiswie/en/person/00047893) ]
211
+ - Quinten Van Baelen [ [email](mailto:quinten.vanbaelen@kuleuven.be) | [website](https://www.kuleuven.be/wieiswie/en/person/00125540) ]
212
+
213
+ ## Contributors
214
+
215
+ Below you find a list of people who contributed in making the toolbox. Feel free to contact them for any repository- or code-specific questions, suggestions or remarks.
216
+
217
+ - Wout Rombouts [ [email](mailto:wout.rombouts@kuleuven.be) | [github profile](https://github.com/rombie18) ]
218
+ - Quinten Van Baelen [ [email](mailto:quinten.vanbaelen@kuleuven.be) | [github profile](https://github.com/quinten-vb) ]
219
+
206
220
  ---
207
221
 
208
222
  Elevate your neural networks with Congrads! 🚀
@@ -75,6 +75,35 @@ If you make use of this package or it's concepts in your research, please consid
75
75
  __ https://www.sciencedirect.com/science/article/abs/pii/S0925231223007592
76
76
  __ https://raw.githubusercontent.com/ML-KULeuven/congrads/main/docs/_static/VanBaelen2023.bib
77
77
 
78
+
79
+ Contacts
80
+ --------
81
+
82
+ Feel free to contact any of the below contact persons for more information or details about the project. Companies interested in a collaboration, or to set up joint research projects are also encouraged to get in touch with us.
83
+
84
+ - Peter Karsmakers [`email`__ | `website`__]
85
+ - Quinten Van Baelen [`email`__ | `website`__]
86
+
87
+ __ mailto:peter.karsmakers@kuleuven.be
88
+ __ https://www.kuleuven.be/wieiswie/en/person/00047893
89
+ __ mailto:quinten.vanbaelen@kuleuven.be
90
+ __ https://www.kuleuven.be/wieiswie/en/person/00125540
91
+
92
+ Contributors
93
+ ------------
94
+
95
+ Below you find a list of people who contributed in making the toolbox. Feel free to contact them for any repository- or code-specific questions, suggestions or remarks.
96
+
97
+ - Wout Rombouts [`email`__ | `github profile`__]
98
+ - Quinten Van Baelen [`email`__ | `github profile`__]
99
+
100
+ __ mailto:wout.rombouts@kuleuven.be
101
+ __ https://github.com/rombie18
102
+ __ mailto:quinten.vanbaelen@kuleuven.be
103
+ __ https://github.com/quinten-vb
104
+
105
+ ---
106
+
78
107
  Contents
79
108
  --------
80
109
 
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
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
File without changes
File without changes
File without changes
File without changes