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 hashes)
Built Distribution
Close
Hashes for text_autoencoder-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e545c8bb4394064cc051e6615fc54ebc0bd823688d5245eceb8b8e5de69b6aa6 |
|
MD5 | bd10162fd842fe3d40c0a3656ce60a6e |
|
BLAKE2b-256 | 9a1a7cd77d8db8903c89b6262c12e29b47bd78ef74e98916d6073850d1349d43 |