Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gp:laboratoare:07 [2025/03/30 21:11]
maria_anca.balutoiu [Layers]
gp:laboratoare:07 [2025/03/30 21:12] (current)
maria_anca.balutoiu [Implementarea unui GAN în PyTorch]
Line 45: Line 45:
  
 ==== Implementarea unui GAN în PyTorch ==== ==== Implementarea unui GAN în PyTorch ====
-<hidden+<code> 
-</hidden>+class Generator(nn.Module):​ 
 +    def __init__(self):​ 
 +        super(Generator,​ self).__init__() 
 +        self.model = nn.Sequential( 
 +            nn.Linear(100,​ 256),  # First linear layer (input: 100 -> 256) 
 +            nn.ReLU(), ​           # Activation function 
 +            nn.Linear(256,​ 512),  # Second linear layer (256 -> 512) 
 +            nn.ReLU(), ​           # Activation function 
 +            nn.Linear(512,​ 1024), # Third linear layer (512 -> 1024) 
 +            nn.ReLU(), ​           # Activation function 
 +            nn.Linear(1024,​ 64*64), ​ # Final layer (1024 -> 64x64 terrain) 
 +            nn.Tanh() ​            # Activation function for output (-1 to 1) 
 +        ) 
 + 
 +    def forward(self,​ x): 
 +        return self.model(x).view(-1,​ 64, 64) 
 +</code> 
  
 ==== Tasks ==== ==== Tasks ====
gp/laboratoare/07.1743358261.txt.gz · Last modified: 2025/03/30 21:11 by maria_anca.balutoiu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0