Skip to main content

Yoctol Natural Language Text Autoencoder

Project description

# text-autoencoder

[![travis][travis-image]][travis-url]
[![pypi][pypi-image]][pypi-url]

[travis-image]: https://img.shields.io/travis/Yoctol/text-autoencoder.svg?style=flat
[travis-url]: https://travis-ci.org/Yoctol/text-autoencoder
[pypi-image]: https://img.shields.io/pypi/v/text-autoencoder.svg?style=flat
[pypi-url]: https://pypi.python.org/pypi/text-autoencoder

Various autoencoder for text data.

## Usage

### Grab one autoencoder first
```python
from text_autoencoder.variational_autoencoders import VAEXXX
model = VAEXXX(n_steps=..., latent_size=..., state_size=..., ...)
```

### How to train
- Warning: please preprocess your data to be a numpy array with shape (data_size, maxlen, embedding_size)
```python
model.fit(x=..., mask=..., epochs=10)
```

### How to save model
```python
model.save(output_path)
```

### How to get latent vector `z`
```python
model.get_latent_vector(x=..., mask=..., batch_size=1)
```

### How to get output of encoder
```python
model.encode(x=..., mask=..., batch_size=1)
```

### How to load a trained model
```python
model.load(path)
```

### How to monitor the training process
- get the output_dir you input when calling `model.fit`
- monitor training loss
```shell
> tensorboard --logdir="<output_dir>/summary/subtrain/"
```

- monitor validation loss
```shell
> tensorboard --logdir="<output_dir>/summary/valid/"
```


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

text-autoencoder-0.0.1.tar.gz (51.9 kB view hashes)

Uploaded Source

Built Distribution

text_autoencoder-0.0.1-py3-none-any.whl (111.3 kB view hashes)

Uploaded Python 3

Supported by

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