Comments (1)
What happens is we initialize the gradients as 0 with "D.zero_grad()", then we add up the gradients of the true examples when using backward(), then we add up the gradients of the fake examples when using backward() and finally we use the optimizer to update the parameters in the direction of the gradients. So backward() doesn't do the learning, it just adds the gradients to the variables (since variables store both data (.data) and gradients (.grad)).
See autograd documentation: http://pytorch.org/docs/master/autograd.html?highlight=backward#torch.autograd.backward
from deep-learning-with-cats.
Related Issues (15)
- try learning rates from "GANs Trained by a Two Time-Scale Update Rule Converge to a Nash Equilibrium": https://arxiv.org/abs/1706.08500 HOT 1
- What would be interesting to see is for each cat the training example closest to it HOT 2
- Would be interesting to try BEGAN HOT 1
- dataset download failed HOT 1
- TypeError: unsupported operand type(s) for /: 'tuple' and 'int' HOT 1
- what is happening if the loss of generator keeps increasing? HOT 8
- SELU weight init HOT 3
- Cat DataSet HOT 2
- Data set problem HOT 1
- Blur caused by WGAN-GP HOT 1
- Invalid Syntax Error HOT 1
- Question about WGAN HOT 1
- How to make folder contain subfolders contain images ? HOT 1
- Some problem happens when we store one image using vutils.save_image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep-learning-with-cats.