Skip to content

Commit 1482de5

Browse files
authored
New examples and refactored module structure (#1)
* refact: move neurons and layers to core for improved clarity * fix: Correct Python version link in README and update license badge style * fix: Update homepage URL in pyproject.toml and add IPython notebook to extend-include * feat: Add examples section to documentation and create datasets module init * fix: Update torch dependency to use compatible version specifier and add examples optional dependencies * feat: Add dataset loading functions and update examples documentation * feat: Rename load_dataset to load_example_dataset and update imports * Remove Jupyter from dev dependencies and add it to examples; include sklearn and tqdm in examples. * feat: include example 01 * feat: update dataset loader API reference to use load_example_dataset
1 parent bb0716f commit 1482de5

File tree

19 files changed

+778
-22
lines changed

19 files changed

+778
-22
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
[![Project Status: WIP](https://img.shields.io/badge/repo_status-WIP-<COLOR>?style=for-the-badge&color=yellow)](https://www.repostatus.org/#WIP) [![Read the Docs](https://img.shields.io/readthedocs/gmp?style=for-the-badge&logo=readthedocs&logoColor=white)](https://gmp.readthedocs.io/en/latest/)
88

9-
[![PyPI](https://img.shields.io/pypi/v/ghonn-models-pytorch?color=red&style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/ghonn-models-pytorch/) [![Python - Version](https://img.shields.io/badge/PYTHON-3.9+-red?style=for-the-badge&logo=python&logoColor=white)](https://pepy.tech/project/segmentation-models-pytorch) [![PyTorch - Version](https://img.shields.io/badge/PYTORCH-2.7+-red?style=for-the-badge&logo=pytorch)](https://pepy.tech/project/ghonn-models-pytorch)
9+
[![PyPI](https://img.shields.io/pypi/v/ghonn-models-pytorch?color=red&style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/ghonn-models-pytorch/) [![Python - Version](https://img.shields.io/badge/PYTHON-3.9+-red?style=for-the-badge&logo=python&logoColor=white)](https://pepy.tech/project/ghonn-models-pytorch) [![PyTorch - Version](https://img.shields.io/badge/PYTORCH-2.7+-red?style=for-the-badge&logo=pytorch)](https://pepy.tech/project/ghonn-models-pytorch)
1010

11-
[![License](https://img.shields.io/badge/License-MIT-<COLOR>.svg?style=for-the-badge&color=blue)](https://github.com/carnosi/ghonn_models_pytorch/blob/main/LICENSE)
11+
[![License](https://img.shields.io/badge/License-MIT-<COLOR>?style=for-the-badge&color=blue)](https://github.com/carnosi/ghonn_models_pytorch/blob/main/LICENSE)
1212

1313
</div>
1414

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_version():
6363
autodoc_mock_imports = [
6464
"torch",
6565
"numpy",
66-
"ghonn_models_pytorch",
66+
# "ghonn_models_pytorch",
6767
]
6868

6969
autoclass_content = "both"

docs/source/examples.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. _examples:
2+
3+
Examples 🧪
4+
============
5+
This section contains a collection of examples that demonstrate how you can use the GHONN Models library.
6+
Examples are in general provided in the form of Jupyter notebooks, which can be run interactively.
7+
New examples will be added over time, so check back every now and then.
8+
9+
Available Jupyter notebooks
10+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11+
- `01_air_passanger_prediction.ipynb <https://github.com/carnosi/ghonn_models_pytorch/blob/main/examples/01_air_passanger_prediction.ipynb>`_
12+
13+
Dataset loader API
14+
~~~~~~~~~~~~~~~~~~~
15+
.. autofunction:: ghonn_models_pytorch.datasets.load_example_dataset
16+
17+
18+
Available Datasets
19+
~~~~~~~~~~~~~~~~~~~~
20+
.. automodule:: ghonn_models_pytorch.datasets.collections
21+
:members:

docs/source/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Welcome to GHONN Models's documentation!
1313

1414
install
1515
quickstart
16+
examples
1617
neurons
1718
network_layers
1819
insights
@@ -23,3 +24,14 @@ Indices and tables
2324
* :ref:`modindex`
2425
* :ref:`search`
2526

27+
References
28+
==========
29+
30+
.. [Jiang_KATS_2022] Xiaodong Jiang, Sudeep Srivastava, Sourav Chatterjee, Yang Yu, Jeffrey Handler,
31+
Peiyi Zhang, Rohan Bopardikar, Dawei Li, Yanjun Lin, Uttam Thakore, Michael Brundage, Ginger Holt,
32+
Caner Komurlu, Rakshita Nagalla, Zhichao Wang, Hechao Sun, Peng Gao, Wei Cheung, Jun Gao, Qi Wang,
33+
Marius Guerard, Morteza Kazemi, Yulin Chen, Chong Zhou, Sean Lee, Nikolay Laptev, Tihamér Levendovszky,
34+
Jake Taylor, Huijun Qian, Jian Zhang, Aida Shoydokova, Trisha Singh, Chengjun Zhu, Zeynep Baz,
35+
Christoph Bergmeir, Di Yu, Ahmet Koylan, Kun Jiang, Ploy Temiyasathit, and Emre Yurtbay.
36+
Kats. 3 2022. `https://github.com/facebookresearch/Kats <https://github.com/facebookresearch/Kats>`_.
37+

docs/source/network_layers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Network Layers 🧩
1010

1111
HONN
1212
~~~~
13-
.. autoclass:: ghonn_models_pytorch.HONN
13+
.. autoclass:: ghonn_models_pytorch.core.HONN
1414

1515
.. _ghonn:
1616

1717
GHONN
1818
~~~~~
19-
.. autoclass:: ghonn_models_pytorch.GHONN
19+
.. autoclass:: ghonn_models_pytorch.core.GHONN

docs/source/neurons.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Neurons 🧠
1010

1111
HONU
1212
~~~~
13-
.. autoclass:: ghonn_models_pytorch.HONU
13+
.. autoclass:: ghonn_models_pytorch.core.HONU
1414

1515
.. _ghonu:
1616

1717
GHONU
1818
~~~~~
19-
.. autoclass:: ghonn_models_pytorch.GHONU
19+
.. autoclass:: ghonn_models_pytorch.core.GHONU

docs/source/quickstart.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ Quick Start 🚀
8787
# Update weights
8888
optimizer.step()
8989
90-
For more information you can check the following examples:
91-
- TBD
90+
.. note::
91+
For additional details and practical usage, please refer to the :doc:`examples` section.

examples/01_air_passanger_prediction.ipynb

Lines changed: 629 additions & 0 deletions
Large diffs are not rendered by default.

ghonn_models_pytorch/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"""GHONN - A Python package for Gated Higher Order Neural Networks."""
22

3-
__version__ = "0.1.0"
3+
__version__ = "0.1.1"
44

5-
from .ghonn import GHONN
6-
from .ghonu import GHONU
7-
from .honn import HONN
8-
from .honu import HONU
5+
from .core import GHONN, GHONU, HONN, HONU
6+
from .datasets import load_example_dataset
97

10-
__all__ = ["GHONN", "GHONU", "HONN", "HONU"]
8+
__all__ = ["GHONN", "GHONU", "HONN", "HONU", "load_example_dataset"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""Core modules for elementary neurons and layers."""
2+
3+
from .ghonn import GHONN
4+
from .ghonu import GHONU
5+
from .honn import HONN
6+
from .honu import HONU
7+
8+
__all__ = ["GHONN", "GHONU", "HONN", "HONU"]

0 commit comments

Comments
 (0)