MCPcopy Create free account
hub / github.com/PKU-ASAL/Simulated-Data / forward

Method forward

src/ETW/model.py:18–25  ·  view source on GitHub ↗
(self,x)

Source from the content-addressed store, hash-verified

16 self.kl = 0
17
18 def forward(self,x):
19 x = F.relu(self.linear1(x))
20 x = F.relu(self.linear2(x))
21 mu = self.linear3(x)
22 sigma = torch.exp(self.linear4(x))
23 z = mu + sigma*self.N.sample(mu.shape)
24 self.kl = (sigma**2 + mu**2 - torch.log(sigma) - 1/2).sum()
25 return z
26class Decoder(nn.Module):
27 def __init__(self,latent_dims):
28 super(Decoder,self).__init__()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected