Yoctol Natural Language Text Autoencoder
Project description
# 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/"
```
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
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
text-autoencoder-0.0.0.tar.gz
(51.6 kB
view details)
Built Distribution
File details
Details for the file text-autoencoder-0.0.0.tar.gz
.
File metadata
- Download URL: text-autoencoder-0.0.0.tar.gz
- Upload date:
- Size: 51.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9f0dbdebae68c0880e1eeaa83af4493f486835fcdca81173da896f555c93d6e |
|
MD5 | 8c3c89957886213d04399d8690218d6b |
|
BLAKE2b-256 | db343318de97fffc3b11b9e34e6691a9352d15e60e4d2ecf2d3e570a96f114ed |
File details
Details for the file text_autoencoder-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: text_autoencoder-0.0.0-py3-none-any.whl
- Upload date:
- Size: 111.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e545c8bb4394064cc051e6615fc54ebc0bd823688d5245eceb8b8e5de69b6aa6 |
|
MD5 | bd10162fd842fe3d40c0a3656ce60a6e |
|
BLAKE2b-256 | 9a1a7cd77d8db8903c89b6262c12e29b47bd78ef74e98916d6073850d1349d43 |