<commit_before># zi2zi: Master Chinese Calligraphy with Conditional Adversarial Networks

[![Insight.io](https://insight.io/repoBadge/github.com/kaonashi-tyc/zi2zi)](https://insight.io/github.com/kaonashi-tyc/zi2zi)

<p align="center">
  <img src="assets/intro.gif" alt="animation", style="width: 350px;"/>
</p>

## Introduction
Learning eastern asian language typefaces with GAN. zi2zi(字到字, meaning from character to character) is an application and extension of the recent popular [pix2pix](https://github.com/phillipi/pix2pix) model to Chinese characters.

Details could be found in this [**blog post**](https://kaonashi-tyc.github.io/2017/04/06/zi2zi.html).

## Network Structure
### Original Model
![alt network](assets/network.png)

The network structure is based off pix2pix with the addition of category embedding and two other losses, category loss and constant loss, from [AC-GAN](https://arxiv.org/abs/1610.09585) and [DTN](https://arxiv.org/abs/1611.02200) respectively.

### Updated Model with Label Shuffling

![alt network](assets/network_v2.png)

After sufficient training, **d_loss** will drop to near zero, and the model's performance plateaued. **Label Shuffling** mitigate this problem by presenting new challenges to the model. 
<commit_msg>remove insight.io badge<commit_after># zi2zi: Master Chinese Calligraphy with Conditional Adversarial Networks

<p align="center">
  <img src="assets/intro.gif" alt="animation", style="width: 350px;"/>
</p>

## Introduction
Learning eastern asian language typefaces with GAN. zi2zi(字到字, meaning from character to character) is an application and extension of the recent popular [pix2pix](https://github.com/phillipi/pix2pix) model to Chinese characters.

Details could be found in this [**blog post**](https://kaonashi-tyc.github.io/2017/04/06/zi2zi.html).

## Network Structure
### Original Model
![alt network](assets/network.png)

The network structure is based off pix2pix with the addition of category embedding and two other losses, category loss and constant loss, from [AC-GAN](https://arxiv.org/abs/1610.09585) and [DTN](https://arxiv.org/abs/1611.02200) respectively.

### Updated Model with Label Shuffling

![alt network](assets/network_v2.png)

After sufficient training, **d_loss** will drop to near zero, and the model's performance plateaued. **Label Shuffling** mitigate this problem by presenting new challenges to the model. 

{'fraction_non_alphanumeric': 0.11882010801828001, 'fraction_numerical': 0.030743664312422102, 'mean_word_length': 5.404255319148936, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3150633', 'n_tokens_mistral': 780, 'n_tokens_neox': 700, 'n_words': 241}