cnn-classifier-toolkit 0.1.0__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.
- cnn_classifier_toolkit-0.1.0/.gitignore +19 -0
- cnn_classifier_toolkit-0.1.0/LICENSE +202 -0
- cnn_classifier_toolkit-0.1.0/PKG-INFO +249 -0
- cnn_classifier_toolkit-0.1.0/README.md +180 -0
- cnn_classifier_toolkit-0.1.0/pyproject.toml +161 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/__init__.py +5 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/_version.py +1 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/cli.py +1085 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/config/__init__.py +17 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/config/loader.py +102 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/config/presets/default.yaml +47 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/config/resolve.py +108 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/config/schema.py +251 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/core/__init__.py +19 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/core/device.py +50 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/core/errors.py +21 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/core/hashing.py +18 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/core/registry.py +46 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/core/seeding.py +37 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/core/types.py +97 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/__init__.py +22 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/adapters/__init__.py +19 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/adapters/_common.py +241 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/adapters/image_folder.py +65 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/adapters/manifest.py +62 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/adapters/numpy.py +96 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/adapters/registry.py +29 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/adapters/synthetic.py +114 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/adapters/torchvision.py +192 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/base.py +17 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/contract.py +28 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/image_io.py +116 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/inspection.py +111 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/loaders.py +79 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/manifest.py +98 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/splits.py +136 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/stats.py +106 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/data/transforms.py +192 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/diagnostics/__init__.py +22 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/diagnostics/activations.py +56 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/diagnostics/architecture.py +172 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/diagnostics/determinism.py +25 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/diagnostics/gradients.py +32 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/diagnostics/sanity.py +49 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/diagnostics/tracing.py +56 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/__init__.py +53 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/bootstrap.py +96 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/calibration.py +74 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/compare.py +111 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/error_analysis.py +61 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/evaluator.py +143 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/latency.py +58 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/metrics.py +94 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/evaluation/predict.py +64 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/models/__init__.py +50 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/models/base.py +62 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/models/residual_cnn.py +138 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/models/simple_cnn.py +55 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/models/summary.py +39 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/models/torchvision.py +46 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/models/transfer.py +193 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/runs/__init__.py +6 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/runs/artifacts.py +50 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/runs/context.py +130 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/tracking/__init__.py +34 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/tracking/base.py +16 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/tracking/composite.py +20 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/tracking/console.py +14 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/tracking/csv.py +19 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/tracking/tensorboard.py +22 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/__init__.py +37 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/amp.py +51 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/callbacks.py +229 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/checkpoint.py +151 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/losses.py +67 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/optim.py +40 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/schedulers.py +53 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/state.py +35 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/training/trainer.py +357 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/__init__.py +42 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/architecture.py +276 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/compare.py +36 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/data.py +56 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/evaluation.py +134 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/features.py +122 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/report.py +821 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/style.py +69 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/templates/report.html.j2 +355 -0
- cnn_classifier_toolkit-0.1.0/src/cnn_classifier/viz/training.py +83 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
.venv/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*.egg-info/
|
|
6
|
+
.pytest_cache/
|
|
7
|
+
.mypy_cache/
|
|
8
|
+
.ruff_cache/
|
|
9
|
+
.hypothesis/
|
|
10
|
+
.coverage
|
|
11
|
+
.coverage.*
|
|
12
|
+
htmlcov/
|
|
13
|
+
dist/
|
|
14
|
+
build/
|
|
15
|
+
site/
|
|
16
|
+
/runs/
|
|
17
|
+
/data/
|
|
18
|
+
.worktrees/
|
|
19
|
+
.claude/worktrees/
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: cnn-classifier-toolkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A config-driven, reproducible PyTorch toolkit for CNN image classification.
|
|
5
|
+
Project-URL: Homepage, https://github.com/pengzhao-ai/cnn-classifier
|
|
6
|
+
Project-URL: Documentation, https://pengzhao-ai.github.io/cnn-classifier/
|
|
7
|
+
Project-URL: Repository, https://github.com/pengzhao-ai/cnn-classifier
|
|
8
|
+
Project-URL: Changelog, https://github.com/pengzhao-ai/cnn-classifier/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Issues, https://github.com/pengzhao-ai/cnn-classifier/issues
|
|
10
|
+
Author: Peng Zhao
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: classification,cnn,deep-learning,experiment-tracking,image-classification,pytorch,reproducible-research,toolkit
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: <3.14,>=3.11
|
|
26
|
+
Requires-Dist: jinja2>=3.1
|
|
27
|
+
Requires-Dist: matplotlib>=3.8
|
|
28
|
+
Requires-Dist: numpy>=2.0
|
|
29
|
+
Requires-Dist: pillow>=10.0
|
|
30
|
+
Requires-Dist: pydantic>=2.6
|
|
31
|
+
Requires-Dist: pyyaml>=6.0
|
|
32
|
+
Requires-Dist: rich>=13.0
|
|
33
|
+
Requires-Dist: tifffile>=2024.1
|
|
34
|
+
Requires-Dist: torch<3,>=2.15
|
|
35
|
+
Requires-Dist: torchvision<1,>=0.29
|
|
36
|
+
Requires-Dist: typer>=0.12
|
|
37
|
+
Provides-Extra: all
|
|
38
|
+
Requires-Dist: hypothesis>=6.98; extra == 'all'
|
|
39
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'all'
|
|
40
|
+
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'all'
|
|
41
|
+
Requires-Dist: mypy>=1.11; extra == 'all'
|
|
42
|
+
Requires-Dist: pandas>=2.2; extra == 'all'
|
|
43
|
+
Requires-Dist: pre-commit>=3.7; extra == 'all'
|
|
44
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'all'
|
|
45
|
+
Requires-Dist: pytest>=8.0; extra == 'all'
|
|
46
|
+
Requires-Dist: ruff>=0.6; extra == 'all'
|
|
47
|
+
Requires-Dist: scikit-learn>=1.4; extra == 'all'
|
|
48
|
+
Requires-Dist: tensorboard>=2.16; extra == 'all'
|
|
49
|
+
Requires-Dist: torchinfo>=1.8; extra == 'all'
|
|
50
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'all'
|
|
51
|
+
Provides-Extra: dev
|
|
52
|
+
Requires-Dist: hypothesis>=6.98; extra == 'dev'
|
|
53
|
+
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
54
|
+
Requires-Dist: pandas>=2.2; extra == 'dev'
|
|
55
|
+
Requires-Dist: pre-commit>=3.7; extra == 'dev'
|
|
56
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
57
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
58
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
59
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
|
|
60
|
+
Provides-Extra: docs
|
|
61
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
|
|
62
|
+
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'docs'
|
|
63
|
+
Provides-Extra: tracking
|
|
64
|
+
Requires-Dist: tensorboard>=2.16; extra == 'tracking'
|
|
65
|
+
Provides-Extra: viz
|
|
66
|
+
Requires-Dist: scikit-learn>=1.4; extra == 'viz'
|
|
67
|
+
Requires-Dist: torchinfo>=1.8; extra == 'viz'
|
|
68
|
+
Description-Content-Type: text/markdown
|
|
69
|
+
|
|
70
|
+
# CNN Classifier Toolkit
|
|
71
|
+
|
|
72
|
+
[](https://www.python.org/)
|
|
73
|
+
[](LICENSE)
|
|
74
|
+
[](https://pengzhao-ai.github.io/cnn-classifier/)
|
|
75
|
+
|
|
76
|
+
A config-driven, reproducible PyTorch toolkit for CNN image classification.
|
|
77
|
+
|
|
78
|
+
The toolkit turns a new image/label dataset into a trained, evaluated, and
|
|
79
|
+
reported classifier through a typed YAML configuration. The same library powers
|
|
80
|
+
the command line, so a quick smoke test and a full experiment use one pipeline.
|
|
81
|
+
|
|
82
|
+
It is published on PyPI as `cnn-classifier-toolkit`; the import package remains
|
|
83
|
+
`cnn_classifier` and the CLI remains `cnncls`.
|
|
84
|
+
|
|
85
|
+
## Results at a glance
|
|
86
|
+
|
|
87
|
+
| Experiment | Result | Budget |
|
|
88
|
+
|---|---:|---|
|
|
89
|
+
| CIFAR-10 scratch baseline | **92.25% test**, 92.78% best validation | 50 epochs, 22.3 min MPS |
|
|
90
|
+
| ResNet-18 fine-tune, 32×32 | **94.98% test** | 30 epochs, 19.5 min MPS |
|
|
91
|
+
| ResNet-18 scratch, 32×32 | 90.88% test | 30 epochs, 19.6 min MPS |
|
|
92
|
+
| ResNet-18 linear probe | 62.66% test | 30 epochs, 8.4 min MPS |
|
|
93
|
+
| Four core ablations | BN on +19.4 pp; cosine +8.5 pp; residual off +0.7 pp; augmentation off +3.1 pp | 8 epochs, 10k train subset |
|
|
94
|
+
| Optical degradation classifier | 85.71% test | 20 epochs, 7.5 s MPS |
|
|
95
|
+
| Bring-your-own-data quickstart | contract verified | 2 epochs, under a minute |
|
|
96
|
+
|
|
97
|
+

|
|
98
|
+
|
|
99
|
+
Reference: 92.42% validation / 92.61% test on MPS, seed 42. The reproduced test
|
|
100
|
+
result is within 0.4 percentage points and clears the ≥90% gate. See the
|
|
101
|
+
[CIFAR-10 case study](https://pengzhao-ai.github.io/cnn-classifier/case_studies/cifar10/)
|
|
102
|
+
for the environment and caveats.
|
|
103
|
+
|
|
104
|
+
## What is in the core
|
|
105
|
+
|
|
106
|
+
| Area | What you get |
|
|
107
|
+
|---|---|
|
|
108
|
+
| Data | torchvision, ImageFolder, CSV manifest, NumPy, and synthetic adapters; 8-bit and 16-bit image I/O; group-safe splits; leakage and duplicate inspection |
|
|
109
|
+
| Models | configurable simple CNN, configurable residual CNN, torchvision backbone wrapper, 32×32 stem adaptation, freezing, differential parameter groups |
|
|
110
|
+
| Training | callbacks, early stopping, checkpoint/resume, AMP, gradient clipping and accumulation, MixUp/CutMix, EMA, warmup/cosine/step/plateau schedules |
|
|
111
|
+
| Evaluation | top-k, per-class metrics, confusion matrices, NLL, calibration (ECE/MCE/Brier), bootstrap intervals, TTA, latency, error analysis |
|
|
112
|
+
| Diagnostics | one-batch overfit, shape tracing, gradient reports, determinism checks |
|
|
113
|
+
| Artifacts | resolved config, environment and git metadata, data fingerprints, metrics, checkpoints, predictions, figures, model contract |
|
|
114
|
+
| Reports | self-contained HTML and Markdown, inline figures, no CDN or network dependency |
|
|
115
|
+
| Devices | automatic CUDA, Apple MPS, or CPU selection |
|
|
116
|
+
|
|
117
|
+
## Install
|
|
118
|
+
|
|
119
|
+
### From PyPI
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pip install cnn-classifier-toolkit
|
|
123
|
+
cnncls doctor
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### From a checkout
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
make sync
|
|
130
|
+
source .venv/bin/activate
|
|
131
|
+
cnncls doctor
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`make sync` installs the package non-editable so the `cnncls` entry point works
|
|
135
|
+
reliably on macOS, where an editable `.pth` can be hidden after PyTorch loads.
|
|
136
|
+
Run `make sync` again after changing library code. Without activating the
|
|
137
|
+
environment, use `uv run --no-sync cnncls ...`.
|
|
138
|
+
|
|
139
|
+
## Quickstart
|
|
140
|
+
|
|
141
|
+
Train a tiny deterministic smoke model with no downloads:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
cnncls train -c configs/tests/synthetic.yaml --set training.epochs=1
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The command creates a run directory under `runs/` containing the resolved
|
|
148
|
+
configuration, data fingerprints, model contract, checkpoints, test
|
|
149
|
+
predictions, figures, `report.html`, and `report.md`.
|
|
150
|
+
|
|
151
|
+
Inspect the pipeline before training:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
cnncls inspect-data -c configs/tests/synthetic.yaml
|
|
155
|
+
cnncls debug -c configs/tests/synthetic.yaml --overfit-batch --steps 20
|
|
156
|
+
cnncls train -c configs/tests/synthetic.yaml --dry-run
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Evaluate, predict, and rebuild reports from artifacts:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
cnncls evaluate --checkpoint runs/<run>/checkpoints/best.pt --split test
|
|
163
|
+
cnncls predict --checkpoint runs/<run>/checkpoints/best.pt --input image.png
|
|
164
|
+
cnncls report --run runs/<run>
|
|
165
|
+
cnncls compare runs/<run-a> runs/<run-b> --out results/comparison
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Demos
|
|
169
|
+
|
|
170
|
+
| Demo | What it shows | Entry point |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| CIFAR-10 scratch | reference residual CNN and the full training path | `python demos/cifar10/scripts/run_scratch.py` |
|
|
173
|
+
| Transfer benchmark | scratch vs linear probe vs fine-tune at 32×32 | `python demos/cifar10/scripts/run_transfer.py` |
|
|
174
|
+
| Ablations | four controlled pairs on a reduced CIFAR split | `python demos/ablations/run_ablations.py` |
|
|
175
|
+
| Optical degradation | manifest data, group-safe splits, confusion analysis | `python demos/optics_degradation/scripts/run_optics.py` |
|
|
176
|
+
| Bring your own data | raw-to-intake contract and custom adapters | `python demos/bring_your_own_data/scripts/run_quickstart.py` |
|
|
177
|
+
|
|
178
|
+
The bring-your-own-data quickstart uses a committed 16-bit fixture and finishes
|
|
179
|
+
in a few seconds.
|
|
180
|
+
|
|
181
|
+
## Command line
|
|
182
|
+
|
|
183
|
+
| Command | Purpose |
|
|
184
|
+
|---|---|
|
|
185
|
+
| `cnncls init DIR` | Scaffold a config, README, and data layout |
|
|
186
|
+
| `cnncls doctor` | Versions, device selection, optional dependencies |
|
|
187
|
+
| `cnncls inspect-data -c CONFIG` | Class balance, duplicates, corruption, leakage, model contract |
|
|
188
|
+
| `cnncls debug -c CONFIG` | One-batch overfit, shape trace, gradients, determinism |
|
|
189
|
+
| `cnncls train -c CONFIG` | Train, evaluate, write figures and the report |
|
|
190
|
+
| `cnncls evaluate --checkpoint PATH` | Evaluate on `test` or `val`, write predictions and metrics |
|
|
191
|
+
| `cnncls predict --checkpoint PATH --input PATH` | Image, folder, or manifest inference |
|
|
192
|
+
| `cnncls report --run DIR` | Rebuild HTML and Markdown from artifacts |
|
|
193
|
+
| `cnncls compare RUN... --out DIR` | Fair comparison with test-fingerprint enforcement |
|
|
194
|
+
|
|
195
|
+
`train --dry-run` builds the dataset and model, runs one forward/backward pass,
|
|
196
|
+
prints the contract and parameter counts, and exits without writing a run.
|
|
197
|
+
|
|
198
|
+
## Documentation
|
|
199
|
+
|
|
200
|
+
The full site is published at
|
|
201
|
+
[https://pengzhao-ai.github.io/cnn-classifier/](https://pengzhao-ai.github.io/cnn-classifier/):
|
|
202
|
+
|
|
203
|
+
- [Quickstart](https://pengzhao-ai.github.io/cnn-classifier/quickstart/)
|
|
204
|
+
- [How it works](https://pengzhao-ai.github.io/cnn-classifier/how_it_works/)
|
|
205
|
+
- [Models & architectures](https://pengzhao-ai.github.io/cnn-classifier/models/)
|
|
206
|
+
- [Configuration](https://pengzhao-ai.github.io/cnn-classifier/configuration/)
|
|
207
|
+
- [Techniques](https://pengzhao-ai.github.io/cnn-classifier/techniques/augmentation/)
|
|
208
|
+
- [CIFAR-10 demo](https://pengzhao-ai.github.io/cnn-classifier/case_studies/cifar10/)
|
|
209
|
+
- [Bring your own data](https://pengzhao-ai.github.io/cnn-classifier/bring_your_own_data/)
|
|
210
|
+
- [CLI](https://pengzhao-ai.github.io/cnn-classifier/cli/)
|
|
211
|
+
- [API](https://pengzhao-ai.github.io/cnn-classifier/api/)
|
|
212
|
+
|
|
213
|
+
## Project layout
|
|
214
|
+
|
|
215
|
+
```text
|
|
216
|
+
src/cnn_classifier/
|
|
217
|
+
├── config/ typed YAML schema, defaults chain, CLI overrides
|
|
218
|
+
├── core/ devices, seeding, hashing, shared contracts
|
|
219
|
+
├── data/ adapters, image I/O, splits, transforms, inspection
|
|
220
|
+
├── models/ CNN builders, torchvision wrapper, transfer utilities
|
|
221
|
+
├── training/ trainer, callbacks, checkpoints, optimizer, schedules, AMP
|
|
222
|
+
├── evaluation/ metrics, calibration, bootstrap, latency, comparison
|
|
223
|
+
├── diagnostics/ overfit, tracing, gradients, determinism
|
|
224
|
+
├── viz/ publication-style figures and HTML/Markdown reports
|
|
225
|
+
├── runs/ run directories and artifact writers
|
|
226
|
+
└── cli.py `cnncls` command line
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Development
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
make test # library tests
|
|
233
|
+
make coverage # core coverage gate
|
|
234
|
+
make lint # ruff
|
|
235
|
+
make typecheck # mypy
|
|
236
|
+
make docs # this site
|
|
237
|
+
make build # wheel and sdist
|
|
238
|
+
make gate # all of the above
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Contributor notes are in [`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
242
|
+
|
|
243
|
+
## License
|
|
244
|
+
|
|
245
|
+
Apache-2.0. See [`LICENSE`](LICENSE).
|
|
246
|
+
|
|
247
|
+
## Citation
|
|
248
|
+
|
|
249
|
+
If you use this toolkit, cite it using [`CITATION.cff`](CITATION.cff).
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# CNN Classifier Toolkit
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://pengzhao-ai.github.io/cnn-classifier/)
|
|
6
|
+
|
|
7
|
+
A config-driven, reproducible PyTorch toolkit for CNN image classification.
|
|
8
|
+
|
|
9
|
+
The toolkit turns a new image/label dataset into a trained, evaluated, and
|
|
10
|
+
reported classifier through a typed YAML configuration. The same library powers
|
|
11
|
+
the command line, so a quick smoke test and a full experiment use one pipeline.
|
|
12
|
+
|
|
13
|
+
It is published on PyPI as `cnn-classifier-toolkit`; the import package remains
|
|
14
|
+
`cnn_classifier` and the CLI remains `cnncls`.
|
|
15
|
+
|
|
16
|
+
## Results at a glance
|
|
17
|
+
|
|
18
|
+
| Experiment | Result | Budget |
|
|
19
|
+
|---|---:|---|
|
|
20
|
+
| CIFAR-10 scratch baseline | **92.25% test**, 92.78% best validation | 50 epochs, 22.3 min MPS |
|
|
21
|
+
| ResNet-18 fine-tune, 32×32 | **94.98% test** | 30 epochs, 19.5 min MPS |
|
|
22
|
+
| ResNet-18 scratch, 32×32 | 90.88% test | 30 epochs, 19.6 min MPS |
|
|
23
|
+
| ResNet-18 linear probe | 62.66% test | 30 epochs, 8.4 min MPS |
|
|
24
|
+
| Four core ablations | BN on +19.4 pp; cosine +8.5 pp; residual off +0.7 pp; augmentation off +3.1 pp | 8 epochs, 10k train subset |
|
|
25
|
+
| Optical degradation classifier | 85.71% test | 20 epochs, 7.5 s MPS |
|
|
26
|
+
| Bring-your-own-data quickstart | contract verified | 2 epochs, under a minute |
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
Reference: 92.42% validation / 92.61% test on MPS, seed 42. The reproduced test
|
|
31
|
+
result is within 0.4 percentage points and clears the ≥90% gate. See the
|
|
32
|
+
[CIFAR-10 case study](https://pengzhao-ai.github.io/cnn-classifier/case_studies/cifar10/)
|
|
33
|
+
for the environment and caveats.
|
|
34
|
+
|
|
35
|
+
## What is in the core
|
|
36
|
+
|
|
37
|
+
| Area | What you get |
|
|
38
|
+
|---|---|
|
|
39
|
+
| Data | torchvision, ImageFolder, CSV manifest, NumPy, and synthetic adapters; 8-bit and 16-bit image I/O; group-safe splits; leakage and duplicate inspection |
|
|
40
|
+
| Models | configurable simple CNN, configurable residual CNN, torchvision backbone wrapper, 32×32 stem adaptation, freezing, differential parameter groups |
|
|
41
|
+
| Training | callbacks, early stopping, checkpoint/resume, AMP, gradient clipping and accumulation, MixUp/CutMix, EMA, warmup/cosine/step/plateau schedules |
|
|
42
|
+
| Evaluation | top-k, per-class metrics, confusion matrices, NLL, calibration (ECE/MCE/Brier), bootstrap intervals, TTA, latency, error analysis |
|
|
43
|
+
| Diagnostics | one-batch overfit, shape tracing, gradient reports, determinism checks |
|
|
44
|
+
| Artifacts | resolved config, environment and git metadata, data fingerprints, metrics, checkpoints, predictions, figures, model contract |
|
|
45
|
+
| Reports | self-contained HTML and Markdown, inline figures, no CDN or network dependency |
|
|
46
|
+
| Devices | automatic CUDA, Apple MPS, or CPU selection |
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
### From PyPI
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install cnn-classifier-toolkit
|
|
54
|
+
cnncls doctor
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### From a checkout
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
make sync
|
|
61
|
+
source .venv/bin/activate
|
|
62
|
+
cnncls doctor
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`make sync` installs the package non-editable so the `cnncls` entry point works
|
|
66
|
+
reliably on macOS, where an editable `.pth` can be hidden after PyTorch loads.
|
|
67
|
+
Run `make sync` again after changing library code. Without activating the
|
|
68
|
+
environment, use `uv run --no-sync cnncls ...`.
|
|
69
|
+
|
|
70
|
+
## Quickstart
|
|
71
|
+
|
|
72
|
+
Train a tiny deterministic smoke model with no downloads:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
cnncls train -c configs/tests/synthetic.yaml --set training.epochs=1
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The command creates a run directory under `runs/` containing the resolved
|
|
79
|
+
configuration, data fingerprints, model contract, checkpoints, test
|
|
80
|
+
predictions, figures, `report.html`, and `report.md`.
|
|
81
|
+
|
|
82
|
+
Inspect the pipeline before training:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
cnncls inspect-data -c configs/tests/synthetic.yaml
|
|
86
|
+
cnncls debug -c configs/tests/synthetic.yaml --overfit-batch --steps 20
|
|
87
|
+
cnncls train -c configs/tests/synthetic.yaml --dry-run
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Evaluate, predict, and rebuild reports from artifacts:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
cnncls evaluate --checkpoint runs/<run>/checkpoints/best.pt --split test
|
|
94
|
+
cnncls predict --checkpoint runs/<run>/checkpoints/best.pt --input image.png
|
|
95
|
+
cnncls report --run runs/<run>
|
|
96
|
+
cnncls compare runs/<run-a> runs/<run-b> --out results/comparison
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Demos
|
|
100
|
+
|
|
101
|
+
| Demo | What it shows | Entry point |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| CIFAR-10 scratch | reference residual CNN and the full training path | `python demos/cifar10/scripts/run_scratch.py` |
|
|
104
|
+
| Transfer benchmark | scratch vs linear probe vs fine-tune at 32×32 | `python demos/cifar10/scripts/run_transfer.py` |
|
|
105
|
+
| Ablations | four controlled pairs on a reduced CIFAR split | `python demos/ablations/run_ablations.py` |
|
|
106
|
+
| Optical degradation | manifest data, group-safe splits, confusion analysis | `python demos/optics_degradation/scripts/run_optics.py` |
|
|
107
|
+
| Bring your own data | raw-to-intake contract and custom adapters | `python demos/bring_your_own_data/scripts/run_quickstart.py` |
|
|
108
|
+
|
|
109
|
+
The bring-your-own-data quickstart uses a committed 16-bit fixture and finishes
|
|
110
|
+
in a few seconds.
|
|
111
|
+
|
|
112
|
+
## Command line
|
|
113
|
+
|
|
114
|
+
| Command | Purpose |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `cnncls init DIR` | Scaffold a config, README, and data layout |
|
|
117
|
+
| `cnncls doctor` | Versions, device selection, optional dependencies |
|
|
118
|
+
| `cnncls inspect-data -c CONFIG` | Class balance, duplicates, corruption, leakage, model contract |
|
|
119
|
+
| `cnncls debug -c CONFIG` | One-batch overfit, shape trace, gradients, determinism |
|
|
120
|
+
| `cnncls train -c CONFIG` | Train, evaluate, write figures and the report |
|
|
121
|
+
| `cnncls evaluate --checkpoint PATH` | Evaluate on `test` or `val`, write predictions and metrics |
|
|
122
|
+
| `cnncls predict --checkpoint PATH --input PATH` | Image, folder, or manifest inference |
|
|
123
|
+
| `cnncls report --run DIR` | Rebuild HTML and Markdown from artifacts |
|
|
124
|
+
| `cnncls compare RUN... --out DIR` | Fair comparison with test-fingerprint enforcement |
|
|
125
|
+
|
|
126
|
+
`train --dry-run` builds the dataset and model, runs one forward/backward pass,
|
|
127
|
+
prints the contract and parameter counts, and exits without writing a run.
|
|
128
|
+
|
|
129
|
+
## Documentation
|
|
130
|
+
|
|
131
|
+
The full site is published at
|
|
132
|
+
[https://pengzhao-ai.github.io/cnn-classifier/](https://pengzhao-ai.github.io/cnn-classifier/):
|
|
133
|
+
|
|
134
|
+
- [Quickstart](https://pengzhao-ai.github.io/cnn-classifier/quickstart/)
|
|
135
|
+
- [How it works](https://pengzhao-ai.github.io/cnn-classifier/how_it_works/)
|
|
136
|
+
- [Models & architectures](https://pengzhao-ai.github.io/cnn-classifier/models/)
|
|
137
|
+
- [Configuration](https://pengzhao-ai.github.io/cnn-classifier/configuration/)
|
|
138
|
+
- [Techniques](https://pengzhao-ai.github.io/cnn-classifier/techniques/augmentation/)
|
|
139
|
+
- [CIFAR-10 demo](https://pengzhao-ai.github.io/cnn-classifier/case_studies/cifar10/)
|
|
140
|
+
- [Bring your own data](https://pengzhao-ai.github.io/cnn-classifier/bring_your_own_data/)
|
|
141
|
+
- [CLI](https://pengzhao-ai.github.io/cnn-classifier/cli/)
|
|
142
|
+
- [API](https://pengzhao-ai.github.io/cnn-classifier/api/)
|
|
143
|
+
|
|
144
|
+
## Project layout
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
src/cnn_classifier/
|
|
148
|
+
├── config/ typed YAML schema, defaults chain, CLI overrides
|
|
149
|
+
├── core/ devices, seeding, hashing, shared contracts
|
|
150
|
+
├── data/ adapters, image I/O, splits, transforms, inspection
|
|
151
|
+
├── models/ CNN builders, torchvision wrapper, transfer utilities
|
|
152
|
+
├── training/ trainer, callbacks, checkpoints, optimizer, schedules, AMP
|
|
153
|
+
├── evaluation/ metrics, calibration, bootstrap, latency, comparison
|
|
154
|
+
├── diagnostics/ overfit, tracing, gradients, determinism
|
|
155
|
+
├── viz/ publication-style figures and HTML/Markdown reports
|
|
156
|
+
├── runs/ run directories and artifact writers
|
|
157
|
+
└── cli.py `cnncls` command line
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Development
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
make test # library tests
|
|
164
|
+
make coverage # core coverage gate
|
|
165
|
+
make lint # ruff
|
|
166
|
+
make typecheck # mypy
|
|
167
|
+
make docs # this site
|
|
168
|
+
make build # wheel and sdist
|
|
169
|
+
make gate # all of the above
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Contributor notes are in [`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
Apache-2.0. See [`LICENSE`](LICENSE).
|
|
177
|
+
|
|
178
|
+
## Citation
|
|
179
|
+
|
|
180
|
+
If you use this toolkit, cite it using [`CITATION.cff`](CITATION.cff).
|