<commit_before># API v2 - Better abstractions

## Exmaples
### discogan

```python
xa = hg.input.ImageDirectory("path/to/horses")
xa = hg.input.ImageDirectory("path/to/zebras")

options1 = {
  encoder:xa,
  input: xb
}
g1 = Generator(options1)

options2 = {
  encoder: xb,
  input: xa
}
g2 = Generator(options2)

gan=GAN(
  generator=[g1,g2],
  losses=[hg.losses.LeastSquares(), hg.losses.UnsupervisedAlignment(g1, g2)]
)

gan.train_for(10000)

```
This could also be a implemented in HG CLI as --align 0,1

# stackgan


```python
options1 = {
  encoder:standard_encoder,
  output_resolution: [64,64,3]
}
g1 = Generator(options1).build()

options2 = {
  encoder: g1,
  output_resolution: [256,256,3]
}
g2 = Generator(options2).build()

gan1=GAN(
  generator=g1
)

gan1.train_for(10000)

# optionally remove the discriminator of gan1 from graph?

gan2 = GAN(
  generator=g2
)

gan2.train_for(10000)

```

# Internal API


One future goal of hypergan is platform agnostic behavior.  Mobile and desktop can be targeted with pbgraph, and treated as runtimes.  Both the discriminator and the generator could prove to be useful.  Javascript
should be considered a target platform as well.

This would involve parsing the config file and constructing a Backend that serves the config.

```python
backend.conv()<commit_msg>[doc] remove .build method<commit_after># API v2 - Better abstractions

## Exmaples
### discogan

```python
xa = hg.input.ImageDirectory("path/to/horses")
xa = hg.input.ImageDirectory("path/to/zebras")

options1 = {
  encoder:xa,
  input: xb
}
g1 = Generator(options1)

options2 = {
  encoder: xb,
  input: xa
}
g2 = Generator(options2)

gan=GAN(
  generator=[g1,g2],
  losses=[hg.losses.LeastSquares(), hg.losses.UnsupervisedAlignment(g1, g2)]
)

gan.train_for(10000)

```
This could also be a implemented in HG CLI as --align 0,1

# stackgan


```python
options1 = {
  encoder:standard_encoder,
  output_resolution: [64,64,3]
}
g1 = Generator(options1)

options2 = {
  encoder: g1,
  output_resolution: [256,256,3]
}
g2 = Generator(options2)

gan1=GAN(
  generator=g1
)

gan1.train_for(10000)

# optionally remove the discriminator of gan1 from graph?

gan2 = GAN(
  generator=g2
)

gan2.train_for(10000)

```

# Internal API


One future goal of hypergan is platform agnostic behavior.  Mobile and desktop can be targeted with pbgraph, and treated as runtimes.  Both the discriminator and the generator could prove to be useful.  Javascript
should be considered a target platform as well.

This would involve parsing the config file and constructing a Backend that serves the config.

```python
backend.conv()
{'fraction_non_alphanumeric': 0.11077274457556148, 'fraction_numerical': 0.041111534069280545, 'mean_word_length': 4.509433962264151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '4863085', 'n_tokens_mistral': 1005, 'n_tokens_neox': 919, 'n_words': 268}