HyperGAN
  • About
  • Getting started
  • CLI guide
  • Configurations
    • Configurable Parameters
  • Showcase
    • AI Explorer for Android
    • Youtube, Twitter, Discord +
  • Examples
    • 2D
    • Text
    • Classification
    • Colorizer
    • Next Frame (video)
  • Tutorials
    • Training a GAN
    • Pygame inference
    • Creating an image dataset
    • Searching for hyperparameters
  • Components
    • GAN
      • Aligned GAN
      • Aligned Interpolated GAN
      • Standard GAN
    • Generator
      • Configurable Generator
      • DCGAN Generator
      • Resizable Generator
    • Discriminator
      • DCGAN Discriminator
      • Configurable Discriminator
    • Layers
      • add
      • cat
      • channel_attention
      • ez_norm
      • layer
      • mul
      • multi_head_attention
      • operation
      • pixel_shuffle
      • residual
      • resizable_stack
      • segment_softmax
      • upsample
    • Loss
      • ALI Loss
      • F Divergence Loss
      • Least Squares Loss
      • Logistic Loss
      • QP Loss
      • RAGAN Loss
      • Realness Loss
      • Softmax Loss
      • Standard Loss
      • Wasserstein Loss
    • Latent
      • Uniform Distribution
    • Trainer
      • Alternating Trainer
      • Simultaneous Trainer
      • Balanced Trainer
      • Accumulate Gradient Trainer
    • Optimizer
    • Train Hook
      • Adversarial Norm
      • Weight Constraint
      • Stabilizing Training
      • JARE
      • Learning Rate Dropout
      • Gradient Penalty
      • Rolling Memory
    • Other GAN implementations
Powered by GitBook
On this page

Was this helpful?

  1. Components
  2. Layers

segment_softmax

    description: 'layer segment_softmax for configurable component'
    ---

    # segment_softmax layer

    `segment_softmax` is a custom layer that allows for masking multiple output channels.

    Suppose you have 30 channels and `segment_softmax 3`. First, the 30 channels split into 15/15.
    The first 15 will be used for softmax and multiplied against the second.
    Then each channel is softmaxed, multiplied, and summed.

    So 30 input channels with 3 output channels equate to 5 input channels for each output channel.

    ## input size

    Any 4-d tensor of the shape `[B, C, H, W]`

    ## output size

    [B, OUTPUT_CHANNELS, H, W]

    ## syntax

    ```json
      "segment_softmax OUTPUT_CHANNELS"
    ```

    ## examples

    At the end of the generator for RGB images:

    ```json
      "conv 30",
      "segment_softmax 3",
      "hardtanh"
    ```
Previousresizable_stackNextupsample

Last updated 4 years ago

Was this helpful?