Skip to main content

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

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

LinkedIn GitHub Email

Sam Layton

LinkedIn GitHub Email

Jeddy Bennett - jeddybennett01@gmail.com

LinkedIn GitHub Email

Nathaniel Driggs

LinkedIn GitHub Email

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foldlayer-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FoldLayer-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

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

Hashes for foldlayer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0e188673ec5ae0da1ebd3f8560e0bf60fef6f7903562792638c0ba9a200145ec
MD5 798ffb31ee0fb204d850553e5fe96177
BLAKE2b-256 628dd001a7989922ed030dbb6dbe477007a72b1bcf793161275a5a583ccdfc9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for foldlayer-0.1.0.tar.gz:

Publisher: python-publish.yml on binDebug3/FoldLayer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for FoldLayer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 070a2ca8efa0b5267ced5922b67cb229552cd91fe2eb6149e7e498354d63a7c0
MD5 d2b3e4935ee157d755611488467945d2
BLAKE2b-256 934fad94466cc4f8fe103d107ff8894b80c8b8705497f3ef1f8e88ee7681165a

See more details on using hashes here.

Provenance

The following attestation bundles were made for FoldLayer-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on binDebug3/FoldLayer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page