semvec/pypi-packages huggingface dataset:
musicalbeeps 0.2.9
Play sound beeps corresponding to musical notes.
License: MIT
Keywords: music musical note notes beep beeps play player sound frequency

[![GitHub](https://img.shields.io/github/license/MaelDrapier/musicalbeeps)](https://github.com/MaelDrapier/musicalbeeps/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/musicalbeeps?color=blue)](https://pypi.org/project/musicalbeeps/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/musicalbeeps)](https://pypi.org/project/musicalbeeps/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/musicalbeeps?color=default)](https://pypi.org/project/musicalbeeps/)

A python package to play sound beeps corresponding to musical notes from the command line or another python program.

This package uses the [numpy](https://pypi.org/project/numpy/) and [simplaudio](https://pypi.org/project/simpleaudio/) packages.

# How to use it from another python program:

```Python
import musicalbeeps


player = musicalbeeps.Player(volume = 0.3,
                            mute_output = False)

# Examples:

# To play an A on default octave n°4 for 0.2 seconds
player.play_note("A", 0.2)

# To play a G flat on octave n°3 for 2.5 seconds
player.play_note("G3b", 2.5)

# To play a F sharp on octave n°5 for the default duration of 0.5 seconds
player.play_note("F5#")

# To pause the player for 3.5 seconds
player.play_note("pause", 3.5)
```

### Initialization parameters for the `Player` class:

|Name|Type|Default|Description|
|:---:|:---:|:---:|:---|
|`volume`|`float`|`0.3`|Set the volume. Must be between `0` and `1`|
|`mute_output`|`bool`|`False`|Mute the output displayed when a note is played|

# How to use it from the command line:

`musicalbeeps --help`
```
usage: musicalbeeps [-h] [--silent] [--volume VOLUME] [file]

Play sound beeps corresponding to musical notes.

positional arguments:
  file             a file containing musical notes

optional arguments:
  -h, --help       show this help message and exit
  --silent         disable player output
  --volume VOLUME  volume between 0 and 1 (default=0.3)

how to play notes:
    Notes are read from a file passed as argument, or directly from the
    standard input. Each note must be on a new line.

note format:
    Each note must be formatted like so: 'A5#:1.5' (without quotes)
    Where:
        - 'A' is the note (between A and G, can be lowercase)
        - '5' is the octave (between 0 and 8, default=4)
        - '#' (or 'b') is optional and used to play a sharp or flat note
        - ':1.5' is the duration of the note (1.5 seconds here, default=0.5)

pause:
    You can pause the player by replacing the note by the 'pause' word.
    For exemple, 'pause:5' will pause the player for 5 seconds.
```

### Examples:
- To play a B sharp on octave n°5 for 1.2 seconds: `echo "B5#:1.2" | musicalbeeps`

- To play the content of a file: `musicalbeeps file_to_play.txt`

Example files are provided in the [**music_scores**](https://github.com/MaelDrapier/musicalbeeps/tree/master/music_scores) directory of the [GitHub repository](https://github.com/MaelDrapier/musicalbeeps).
wild-relation-network 0.1.0
Wild Relation Network for solving Raven's Progressive Matrices
License: MIT
Requires Python: >=3.6
Keywords: artificial intelligence,relation network,wild relation network

![image](wren.png)

# Wild Relation Network
PyTorch implementation of Relation Network [1] and Wild Relation Network [2] for solving Raven's Progressive Matrices.

## Setup
```bash
$ pip install wild_relation_network
```

## Usage
Relation Network:
```python
import torch

from wild_relation_network import RelationNetwork

x = torch.rand(4, 8, 64)
rn = RelationNetwork(
    num_objects=8,
    object_size=64,
    out_size=32,
    use_object_triples=False,
    use_layer_norm=False
)
logits = rn(x)
logits  # torch.Tensor with shape (4, 32)
```

Wild Relation Network:
```python
import torch

from wild_relation_network import WReN

x = torch.rand(4, 16, 160, 160)
wren = WReN(
    num_channels=32,
    use_object_triples=False,
    use_layer_norm=False
)
logits = wren(x)
y_hat = logits.log_softmax(dim=-1)
y_hat  # torch.Tensor with shape (4, 8)
```

## Unit tests
```bash
$ python -m pytest tests
```

## Bibliography
[1] Santoro, Adam, et al. "A simple neural network module for relational reasoning." Advances in neural information processing systems. 2017.

[2] Santoro, Adam, et al. "Measuring abstract reasoning in neural networks." International Conference on Machine Learning. 2018.

## Citations
```bibtex
@inproceedings{santoro2017simple,
  title={A simple neural network module for relational reasoning},
  author={Santoro, Adam and Raposo, David and Barrett, David G and Malinowski, Mateusz and Pascanu, Razvan and Battaglia, Peter and Lillicrap, Timothy},
  booktitle={Advances in neural information processing systems},
  pages={4967--4976},
  year={2017}
}
```

```bibtex
@inproceedings{santoro2018measuring,
  title={Measuring abstract reasoning in neural networks},
  author={Santoro, Adam and Hill, Felix and Barrett, David and Morcos, Ari and Lillicrap, Timothy},
  booktitle={International Conference on Machine Learning},
  pages={4477--4486},
  year={2018}
}
```