Skip to content

Commit

Permalink
RDS-684: Provide error message for bad batch_size and pac values in A…
Browse files Browse the repository at this point in the history
…CTGAN

GitOrigin-RevId: 4c244f5a6161a250ac8c874f53d1a0162304f737
  • Loading branch information
kboyd committed Aug 7, 2023
1 parent fb1bd22 commit eab2e97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gretel_synthetics/actgan/actgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def calc_gradient_penalty(

def forward(self, input_):
"""Apply the Discriminator to the `input_`."""
assert input_.size()[0] % self.pac == 0
return self.seq(input_.view(-1, self.pacdim))


Expand Down Expand Up @@ -250,6 +249,9 @@ def __init__(
if batch_size % 2 != 0:
raise ValueError("`batch_size` must be divisible by 2")

if batch_size % pac != 0:
raise ValueError("`batch_size` must be divisible by `pac` (defaults to 10)")

self._embedding_dim = embedding_dim
self._generator_dim = generator_dim
self._discriminator_dim = discriminator_dim
Expand Down

0 comments on commit eab2e97

Please sign in to comment.