Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderVNikitin committed Oct 23, 2023
1 parent 3ecbc51 commit bad59b2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,32 @@ The easiest way to make a pull request is to fork the repo, see [GitHub document

## Development
To install TSGM in development mode, first install prerequisites:
```
```bash
pip install -r requirements/requirements.txt
pip install -r requirements/tests_requirements.txt
pip install -r requirements/docs_requirements.txt
```

and then, install TSGM in development mode:
```
```bash
python setup.py develop
```

To run tests, use pytest, for example:
```
```bash
pytest tests/test_cgan.py::test_temporal_cgan
```

To run linters, use:
```
```bash
flake8 tsgm/
```

## Documenting
We aim to produce high-quality documentation to help our users to use the library. In your contribution, please edit corresponding documentation pages in [./docs](https://github.com/AlexanderVNikitin/tsgm/tree/main/docs).

To build the documentation, use:
```
```bash
cd docs
make html
```
40 changes: 39 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,45 @@ Time Series Simulator (TSGM) Official Documentation
Time Series Generative Modeling (TSGM) is a Python framework for time series data generation. It include data-driven and model-based approaches to synthetic time-series generation. It uses both generative


The package is built on top of `Tensorflow <https://www.tensorflow.org/>`_ that allows training the models on CPUs, or GPUs.
The package is built on top of `Tensorflow <https://www.tensorflow.org/>`_ that allows training the models on CPUs, GPUs, or TPUs.

Quick start:

.. code-block:: bash
pip install tsgm
.. code-block:: python
import tsgm
# ... Define hyperparameters ...
# dataset is a tensor of shape n_samples x seq_len x feature_dim
# Zoo contains several prebuilt architectures: we choose a conditional GAN architecture
architecture = tsgm.models.architectures.zoo["cgan_base_c4_l1"](
seq_len=seq_len, feat_dim=feature_dim,
latent_dim=latent_dim, output_dim=0)
discriminator, generator = architecture.discriminator, architecture.generator
# Initialize GAN object with selected discriminator and generator
gan = tsgm.models.cgan.GAN(
discriminator=discriminator, generator=generator, latent_dim=latent_dim
)
gan.compile(
d_optimizer=keras.optimizers.Adam(learning_rate=0.0003),
g_optimizer=keras.optimizers.Adam(learning_rate=0.0003),
loss_fn=keras.losses.BinaryCrossentropy(from_logits=True),
)
gan.fit(dataset, epochs=1)
# Generate 10 synthetic samples
result = gan.generate(10)
For more examples, see `our tutorials <https://github.com/AlexanderVNikitin/tsgm/tree/main/tutorials>`_.

If you find this repo useful, please consider citing our paper:

.. code-block:: latex

Expand Down

0 comments on commit bad59b2

Please sign in to comment.