A package for fold layers in neural networks
Project description
Fold Layer
The Fold Layer is a novel neural network layer designed to transform high-dimensional data with efficient learning and reduced complexity. Inspired by principles of geometric folding, this model employs a custom nonlinearity to reshape data through learned hyperplanes, allowing for non-linear transformations that improve prediction speed and convergence.
Table of Contents
- Overview
- Features
- Architecture
- Installation
- Usage
- Examples
- Research & Development
- Contributing
- License
- Workflow
Overview
The Fold Layer architecture introduces a data transformation process similar to folding in origami, where input data is sequentially mapped across high-dimensional hyperplanes. This process enables:
- A reduced need for large, high-parameter layers in standard architectures.
- Accelerated prediction through hyperplane-based data folding.
- Simplified optimization, using fewer trainable parameters to capture complex data patterns.
Features
- Custom Nonlinearity: Each layer learns a set of hyperplanes to reshape the data dynamically, reducing training time.
- Optimized Performance: Through reduced parameterization, fold layers achieve lower latency at run time.
- Configurable Optimizers: Support for various optimizers to best match the model's fold-based architecture.
- Improved Memory Efficiency: Fewer parameters make Fold Layers more memory and parameter efficient.
- Interpretability: Fold operations provide a more intuitive and interpretable alternative to traditional deep learning models.
Architecture
The fold layers are inspired by origami and the Fold and Cut Theorem to emulate a ReLU function but add the capability to fold data into more separable forms in fewer steps. They modify the data by finding the projection of the data onto a hyperplane and then adding the projection to the data twice in N-dimensional space to 'fold' the data. This process is repeated for each fold layer in the model. The fold layer is defined by the following equation:
$$ L_p(\mathbf{x}, \mathbf{n}p) = \mathbf{x} - 2 \left( \mathbb{1}{{\mathbf{n}_p \cdot \mathbf{x} > \mathbf{n}_p \cdot \mathbf{n}_p}} \right) \left(1 - \frac{\mathbf{x} \cdot \mathbf{n}_p}{\lVert \mathbf{n}_p \rVert} \right) \mathbf{n}_p $$
Installation
You can install this package from PyPi with
pip install FoldLayer
or
python -m pip install --upgrade FoldLayer
Usage
This section is under development. Please check back soon for usage instructions.
import fold_layer
Research and Development
The Fold Layer is under active research, focusing on:
- Experimenting with different fold depth and width configurations.
- Testing efficiency gains in prediction for natural language processing, computer vision, and other domains.
- Identifying optimizers that best support fold-layer dynamics.
- Experimenting with folds in higher dimensions.
- Developing a fold version of convolutional neural networks.
Contributing
Contributions to improve the Fold Layer, fix bugs, or add features are welcome! Please open an issue or submit a pull request.
Current Contributors:
Dallin Stewart - dallinpstewart@gmail.com
Sam Layton
Jeddy Bennett - jeddybennett01@gmail.com
Nathaniel Driggs
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file foldlayer-0.1.0.tar.gz.
File metadata
- Download URL: foldlayer-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e188673ec5ae0da1ebd3f8560e0bf60fef6f7903562792638c0ba9a200145ec
|
|
| MD5 |
798ffb31ee0fb204d850553e5fe96177
|
|
| BLAKE2b-256 |
628dd001a7989922ed030dbb6dbe477007a72b1bcf793161275a5a583ccdfc9f
|
Provenance
The following attestation bundles were made for foldlayer-0.1.0.tar.gz:
Publisher:
python-publish.yml on binDebug3/FoldLayer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
foldlayer-0.1.0.tar.gz -
Subject digest:
0e188673ec5ae0da1ebd3f8560e0bf60fef6f7903562792638c0ba9a200145ec - Sigstore transparency entry: 168816670
- Sigstore integration time:
-
Permalink:
binDebug3/FoldLayer@6813355d1c65a64071763539ee973607c73ce177 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/binDebug3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6813355d1c65a64071763539ee973607c73ce177 -
Trigger Event:
release
-
Statement type:
File details
Details for the file FoldLayer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: FoldLayer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
070a2ca8efa0b5267ced5922b67cb229552cd91fe2eb6149e7e498354d63a7c0
|
|
| MD5 |
d2b3e4935ee157d755611488467945d2
|
|
| BLAKE2b-256 |
934fad94466cc4f8fe103d107ff8894b80c8b8705497f3ef1f8e88ee7681165a
|
Provenance
The following attestation bundles were made for FoldLayer-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on binDebug3/FoldLayer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
foldlayer-0.1.0-py3-none-any.whl -
Subject digest:
070a2ca8efa0b5267ced5922b67cb229552cd91fe2eb6149e7e498354d63a7c0 - Sigstore transparency entry: 168816672
- Sigstore integration time:
-
Permalink:
binDebug3/FoldLayer@6813355d1c65a64071763539ee973607c73ce177 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/binDebug3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6813355d1c65a64071763539ee973607c73ce177 -
Trigger Event:
release
-
Statement type: