Skip to content

Commit

Permalink
Restructured examples directory and slightly modified "LICENSE" to cl…
Browse files Browse the repository at this point in the history
…arify copyrights of contributions.
  • Loading branch information
bschaefl committed Aug 20, 2020
1 parent a1271f6 commit 5f279bb
Show file tree
Hide file tree
Showing 23 changed files with 1,593 additions and 1,583 deletions.
4 changes: 4 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ From Hopfield layers:
Copyright (c) 2020, Institute for Machine Learning, Johannes Kepler University Linz (Bernhard Schäfl)
All rights reserved.

All other contributions:
Copyright (c) 2020 the respective contributors
All rights reserved.

From PyTorch:

Copyright (c) 2016- Facebook, Inc (Adam Paszke)
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ Generally, the Hopfield layer is designed to be used to implement or to substitu

The folder [examples](examples/) contains multiple demonstrations on how to use the <code>Hopfield</code> as well as the <code>HopfieldPooling</code> modules. To successfully run the contained [Jupyter notebooks](https://jupyter.org), additional third-party modules like [pandas](https://pandas.pydata.org) and [seaborn](https://seaborn.pydata.org) are required.

- [Bit Pattern Set](examples/bit_pattern_demo.ipynb): The dataset of this demonstration falls into the category of <i>binary classification</i> tasks in the domain of <i>Multiple Instance Learning (MIL)</i> problems. Each bag comprises a collection of bit pattern instances, wheres each instance is a sequence of <b>0s</b> and <b>1s</b>. The positive class has specific bit patterns injected, which are absent in the negative one. This demonstration shows, that <code>Hopfield</code> and <code>HopfieldPooling</code> are capable of learning and filtering each bag with respect to the class-defining bit patterns.
- [Bit Pattern Set](examples/bit_pattern/bit_pattern_demo.ipynb): The dataset of this demonstration falls into the category of <i>binary classification</i> tasks in the domain of <i>Multiple Instance Learning (MIL)</i> problems. Each bag comprises a collection of bit pattern instances, wheres each instance is a sequence of <b>0s</b> and <b>1s</b>. The positive class has specific bit patterns injected, which are absent in the negative one. This demonstration shows, that <code>Hopfield</code> and <code>HopfieldPooling</code> are capable of learning and filtering each bag with respect to the class-defining bit patterns.

- [Latch Sequence Set](examples/latch_sequence_demo.ipynb): We study an easy example of learning long-term dependencies by using a simple <i>latch task</i>, see [Hochreiter and Mozer](https://link.springer.com/chapter/10.1007/3-540-44668-0_92). The essence of this task is that a sequence of inputs is presented, beginning with one of two symbols, <b>A</b> or <b>B</b>, and after a variable number of time steps, the model has to output a corresponding symbol. Thus, the task requires memorizing the original input over time. It has to be noted, that both class-defining symbols must only appear at the first position of a sequence. This task was specifically designed to demonstrate the capability of recurrent neural networks to capture long term dependencies. This demonstration shows, that <code>Hopfield</code> and <code>HopfieldPooling</code> adapt extremely fast to this specific task, concentrating only on the first entry of the sequence.
- [Latch Sequence Set](examples/latch_sequence/latch_sequence_demo.ipynb): We study an easy example of learning long-term dependencies by using a simple <i>latch task</i>, see [Hochreiter and Mozer](https://link.springer.com/chapter/10.1007/3-540-44668-0_92). The essence of this task is that a sequence of inputs is presented, beginning with one of two symbols, <b>A</b> or <b>B</b>, and after a variable number of time steps, the model has to output a corresponding symbol. Thus, the task requires memorizing the original input over time. It has to be noted, that both class-defining symbols must only appear at the first position of a sequence. This task was specifically designed to demonstrate the capability of recurrent neural networks to capture long term dependencies. This demonstration shows, that <code>Hopfield</code> and <code>HopfieldPooling</code> adapt extremely fast to this specific task, concentrating only on the first entry of the sequence.

## Disclaimer

Expand All @@ -100,4 +100,8 @@ Some implementations of this repository are based on existing ones of the offici
- The implementation of [HopfieldCore](modules/activation.py#L11) is based on the implementation of [MultiheadAttention](https://github.com/pytorch/pytorch/blob/b31f58de6fa8bbda5353b3c77d9be4914399724d/torch/nn/modules/activation.py#L771).
- The implementation of [hopfield_core_forward](modules/functional.py#L8) is based on the implementation of [multi_head_attention_forward](https://github.com/pytorch/pytorch/blob/b31f58de6fa8bbda5353b3c77d9be4914399724d/torch/nn/functional.py#L3854).
- The implementation of [HopfieldEncoderLayer](modules/transformer.py#L12) is based on the implementation of [TransformerEncoderLayer](https://github.com/pytorch/pytorch/blob/b31f58de6fa8bbda5353b3c77d9be4914399724d/torch/nn/modules/transformer.py#L241).
- The implementation of [HopfieldDecoderLayer](modules/transformer.py#L88) is based on the implementation of [TransformerDecoderLayer](https://github.com/pytorch/pytorch/blob/b31f58de6fa8bbda5353b3c77d9be4914399724d/torch/nn/modules/transformer.py#L303).
- The implementation of [HopfieldDecoderLayer](modules/transformer.py#L88) is based on the implementation of [TransformerDecoderLayer](https://github.com/pytorch/pytorch/blob/b31f58de6fa8bbda5353b3c77d9be4914399724d/torch/nn/modules/transformer.py#L303).

## License

This repository is BSD-style licensed (see [LICENSE](LICENSE)), except where noted otherwise.
1 change: 0 additions & 1 deletion examples/auxiliary

This file was deleted.

1 change: 1 addition & 0 deletions examples/bit_pattern/auxiliary
Loading

0 comments on commit 5f279bb

Please sign in to comment.