Skip to content

Commit

Permalink
Add new documentation (#2)
Browse files Browse the repository at this point in the history
* Add new documentation

* Add new info and versions

* Add files
  • Loading branch information
enmanuelmag authored Sep 14, 2022
1 parent bc9607a commit 716ae43
Show file tree
Hide file tree
Showing 45 changed files with 22,877 additions and 5 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,24 @@
/dist/

__pycache__/

# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# IA Workflow
# IAfLow
This library help to create models with identifiers, checkpoints, logs and metadata automatically, in order to make the training process more efficient and traceable.

## Requirements
Expand Down
20 changes: 20 additions & 0 deletions documentation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions documentation/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
12 changes: 12 additions & 0 deletions documentation/blog/2019-05-28-first-blog-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
slug: first-blog-post
title: First Blog Post
authors:
name: Gao Wei
title: Docusaurus Core Team
url: https://github.com/wgao19
image_url: https://github.com/wgao19.png
tags: [hola, docusaurus]
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
44 changes: 44 additions & 0 deletions documentation/blog/2019-05-29-long-blog-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
slug: long-blog-post
title: Long Blog Post
authors: endi
tags: [hello, docusaurus]
---

This is the summary of a very long blog post,

Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.

<!--truncate-->

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
20 changes: 20 additions & 0 deletions documentation/blog/2021-08-01-mdx-blog-post.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
slug: mdx-blog-post
title: MDX Blog Post
authors: [slorber]
tags: [docusaurus]
---

Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).

:::tip

Use the power of React to create interactive blog posts.

```js
<button onClick={() => alert('button clicked!')}>Click me!</button>
```

<button onClick={() => alert('button clicked!')}>Click me!</button>

:::
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions documentation/blog/2021-08-26-welcome/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
slug: welcome
title: Welcome
authors: [slorber, yangshun]
tags: [facebook, hello, docusaurus]
---

[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).

Simply add Markdown files (or folders) to the `blog` directory.

Regular blog authors can be added to `authors.yml`.

The blog post date can be extracted from filenames, such as:

- `2019-05-30-welcome.md`
- `2019-05-30-welcome/index.md`

A blog post folder can be convenient to co-locate blog post images:

![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg)

The blog supports tags as well!

**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.
17 changes: 17 additions & 0 deletions documentation/blog/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
endi:
name: Endilie Yacop Sucipto
title: Maintainer of Docusaurus
url: https://github.com/endiliey
image_url: https://github.com/endiliey.png

yangshun:
name: Yangshun Tay
title: Front End Engineer @ Facebook
url: https://github.com/yangshun
image_url: https://github.com/yangshun.png

slorber:
name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
8 changes: 8 additions & 0 deletions documentation/docs/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Guides",
"position": 2,
"link": {
"type": "generated-index",
"description": "5 minutes to learn the most important Docusaurus concepts."
}
}
73 changes: 73 additions & 0 deletions documentation/docs/guides/main-class.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
sidebar_position: 1
---

# Main class

This library has a maser class called `IAFlow`, that has functions to management model creation and training. In this section, we will see the CRUD for models.

## Constructor

The constructor of `IAFlow` class has the following parameters:

- **models_folder**: Folder to save the models.
- **params_notifier**: Parameters for notifier, see documentation [here](https://pypi.org/project/notify-function/#description).
- **builder_function**: Function to build the model.
- **checkpoint_params** (optional): Parameters for checkpoint, see documentation [here](https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ModelCheckpoint).
- **tensorboard_params** (optional): Parameters for tensorboard, see documentation [here](https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/TensorBoard).

```python title="IAFlow constructor"
from iaflow import IAFlow

def custom_builder(input_shape):
model = Sequential([
Dense(units=512, activation='relu'),
Dense(units=512, activation='relu'),
Dense(units=1, activation='sigmoid')
])
return model

# Parameters for notifier, see documentation
# https://pypi.org/project/notify-function/#description
params_notifier = {
'title': 'Training update',
'webhook_url': os.environ.get('WEBHOOK_URL'),
'frequency_epoch': 20 # Send a notification every 20 epochs, by default it is every epoch
}

ia_maker = IAFlow(
models_folder='./models',
params_notifier=params_notifier,
builder_function=custom_builder,
checkpoint_params={
'monitor': 'val_loss',
'save_best_only': True,
'save_weights_only': True
},
tensorboard_params={
'histogram_freq': 1,
'write_graph': True,
'write_images': True
}
)
```

## Update builder function

The `update_builder_function` method is used to update the builder function. Has the following parameters:

- **builder_function**: New function to build the model.

```python title=Example
ia_maker.update_builder_function(custom_builder_2)
```

## Update notifier parameters

The `update_notifier_parameters` method is used to update the notifier parameters. Has the following parameters:

- **params_notifier**: New parameters for notifier, see documentation [here](https://pypi.org/project/notify-function/#description).

```python title=Example
ia_maker.update_notifier_parameters(params_notifier_2)
```
83 changes: 83 additions & 0 deletions documentation/docs/guides/management-datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
sidebar_position: 3
---

# Management datasets

The instance created by the [Main class](./main-class) allow to manage the datasets, in this section we will see the CRUD for datasets.

## Create dataset

The `add_dataset` method is used to define a dataset. Has the following parameters:

- **name** (string): Name of the dataset.
- **epochs** (int): Number of epochs to train the model.
- **train_ds** (tf.data.Dataset | List): Dataset to train the model.
- **val_ds** (tf.data.Dataset | List, optional): Dataset to validate the model.
- **test_ds** (tf.data.Dataset | List, optional): Dataset to test the model.
- **batch_size** (int, optional): Batch size to train the model.
- **shuffle_buffer** (int, optional): Buffer size to shuffle the dataset.

```python title=Example
all_data = tf.data.Dataset.from_tensor_slices((
tf.random.uniform([1000, 2]),
tf.random.uniform([1000, 1])
))

train_ds = all_data.take(5)
val_ds = all_data.skip(5)

ia_maker.add_dataset(
name='dataset_1',
epochs=10,
batch_size=32,
shuffle_buffer=512,
train_ds=train_ds,
val_ds=val_ds
)
```

```bash title=Output
Dataset dataset_1 was added
```

## Update dataset

The `update_dataset` method is used to update a dataset. Has the following parameters:

- **name** (string): Name of the dataset to update.
- **epochs** (int): New number of epochs to train the model.
- **train_ds** (tf.data.Dataset | List): New dataset to train the model.
- **val_ds** (tf.data.Dataset | List): New dataset to validate the model.
- **test_ds** (tf.data.Dataset | List): New dataset to test the model.
- **batch_size** (int): New batch size to train the model.
- **shuffle_buffer** (int): New buffer size to shuffle the dataset.

```python title=Example
ia_maker.update_dataset(
name='dataset_1',
epochs=50,
batch_size=128,
shuffle_buffer=1024,
train_ds=train_ds_2,
val_ds=val_ds_2
)
```

```bash title=Output
Dataset dataset_1 was updated
```

## Delete dataset

The `delete_dataset` method is used to delete a dataset. Has the following parameters:

- **name** (string): Name of the dataset to delete.

```python title=Example
ia_maker.delete_dataset(name='dataset_1')
```

```bash title=Output
Dataset dataset_1 was deleted
```
Loading

0 comments on commit 716ae43

Please sign in to comment.