Skip to content

Commit

Permalink
updated constraint on custom layers
Browse files Browse the repository at this point in the history
  • Loading branch information
fedepup committed Apr 9, 2024
1 parent 95a2dd9 commit 1d2d421
Show file tree
Hide file tree
Showing 13 changed files with 1,282 additions and 581 deletions.
13 changes: 12 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

**Functionality**

* EEGdataset can preload the entire dataset.
- **dataloading module**:
- EEGdataset can preload the entire dataset.
- **models module**:
- custom layers were moved in a new models.layer submodule
- layer constraints now include MaxNorm, MinMaxNorm, UnitNorm, with axis selection like in Keras.
- added Conv1d layer with norm constraint

**Maintenance**

* fixed typos on model module unittest.
* Added new tests for novel functionalities.


# Version 0.1.1 (latest)

Expand Down
20 changes: 20 additions & 0 deletions docs/api/selfeeg.models.layers.ConstrainedConv1d.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ConstrainedConv1d
=================

.. currentmodule:: selfeeg.models.layers

.. autoclass:: ConstrainedConv1d
:show-inheritance:
:noindex:

.. rubric:: Methods Summary

.. autosummary::

~ConstrainedConv1d.forward
~ConstrainedConv1d.scale_norm

.. rubric:: Methods Documentation

.. automethod:: forward
.. automethod:: scale_norm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ConstrainedConv2d
=================

.. currentmodule:: selfeeg.models.zoo
.. currentmodule:: selfeeg.models.layers

.. autoclass:: ConstrainedConv2d
:show-inheritance:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ConstrainedDense
================

.. currentmodule:: selfeeg.models.zoo
.. currentmodule:: selfeeg.models.layers

.. autoclass:: ConstrainedDense
:show-inheritance:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DepthwiseConv2d
===============

.. currentmodule:: selfeeg.models.zoo
.. currentmodule:: selfeeg.models.layers

.. autoclass:: DepthwiseConv2d
:show-inheritance:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SeparableConv2d
===============

.. currentmodule:: selfeeg.models.zoo
.. currentmodule:: selfeeg.models.layers

.. autoclass:: SeparableConv2d
:show-inheritance:
Expand Down
17 changes: 14 additions & 3 deletions docs/selfeeg.models.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
selfeeg.models
==============

This module collects various Deep Learning models proposed for EEG applications.
In addition, it implements some layers not directly available in the PyTorch nn.Module, such as:
a Depthwise Conv2d layer, a Separable Conv2d layer, Conv2d with max norm constraint, Linear layer with max norm constraint.
This module collects various Deep Learning models and custom layers.
It is divided in two submodules:

- **layers**: a collection custom layers with the possibility to add norm constraints.
- **zoo**: a collection of deep learning models proposed for EEG applications.

models.layers module
--------------------

.. automodapi:: selfeeg.models.layers
:no-inheritance-diagram:
:no-main-docstr:
:noindex:
:no-heading:

models.zoo module
-----------------
Expand Down
2 changes: 2 additions & 0 deletions selfeeg/dataloading/load.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import glob
import math
import os
Expand Down
9 changes: 9 additions & 0 deletions selfeeg/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .zoo import (
BasicBlock1,
ConstrainedConv1d,
ConstrainedConv2d,
ConstrainedDense,
DeepConvNet,
Expand All @@ -23,3 +24,11 @@
TinySleepNet,
TinySleepNetEncoder,
)

from .layers import (
ConstrainedConv1d,
ConstrainedConv2d,
ConstrainedDense,
DepthwiseConv2d,
SeparableConv2d,
)
Loading

0 comments on commit 1d2d421

Please sign in to comment.