Comments (1)
Hi, @andreas128
I think the code is correct.
The procedure is that we train netG and netD iteratively.
The code you paste is for training the netD. When we train the netD, we only update the parameters of the netD. We detach the self.fake_H
so that the gradients will not back-propagate the the netG. (If we omit detach operation, then the gradients will also back-propagate to the netG. But it is useless, since in this step we only need to update the netD)
The update for the netG is in other lines:
pred_g_fake = self.netD(self.fake_H)
, in this line, the gradients will back-propagate to the self.fake_H and then the netG. The optimizer self.optimizer_G
will update the G parameters.
from basicsr.
Related Issues (20)
- how to speed up the training procession with the new tools such as Apex、deepspeed 、torch.complie e.g. ?
- experiments 子目录无法即时创建 | Sub-directories of experiments folder cannot be created in time. HOT 2
- The results obtained during validation and test are inconsistent HOT 3
- 这个项目没人维护了?
- How can I use load_resume_state? HOT 1
- 如何指定使用GPU=[3,4,5,6]训练,不使用GPU=0?
- PYPI麻烦同步更新下 HOT 1
- How to draw a learning rate curve in Tensorboard or Wandb?
- raise KeyError(f"No object named '{name}' found in '{self._name}' registry!")
- 训练的时候要对整张图片进行一个patch_size的划分,验证和测试就不用了吗 HOT 1
- [SUGGESTION] Wider hardware acceleration support
- Fine-tuning ESRGAN model
- TypeError: unsupported operand type(s) for *: 'float' and 'collections.OrderedDict' error when executing net_interp.py
- 您好,HiFaceGAN找不到GANFeatLoss(I cannot use GANFeatLoss when trying to run HiFaceGAN by BasicSR) HOT 1
- Model Conversion
- Early stopping of model
- Custom Loss on Real-ESRGAN fine tune?
- How to get files in DIV2K_train_LR_bicubic/X4 directory in extract_subimages.py file
- 在测试模型时出现乱码问题,怎么办
- Inference error
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 basicsr.