Giter VIP home page Giter VIP logo

Comments (2)

luolanfeixue avatar luolanfeixue commented on May 31, 2024

看名字知道您是**人,所以冒昧用中文提issue了。
1、这个magic model怎么就能做到这样,dev_loss为什么会更新generator的参数呢?

2、这里是用到了前一次classifer到梯度了吗
deltas = _adam_delta(self._optimizer, self._model, grads)
magic_model.update_params(deltas)

from learning-data-manipulation.

tanyuqian avatar tanyuqian commented on May 31, 2024

Yes, you are right:) I'll use English to reply for possible inspirations to everyone.

"how to understand magic_model?" -- It's for running a specified model (e.g., BERT) whose parameters are the sum of multiple sets of parameters (e.g., \theta + \theta'(\phi)) while we don't need to re-write the original forward() function. Our implementation is a bit like a hack to PyTorch.Module. If you have better ways to do it, please let me know.

"why can dev_loss.backward() update the Generator weight?" -- In the code, the route of gradient propagation is dev_loss (classifier.p::Line154) -> deltas (Line 147) -> grads (Line 140) -> aug_probs (Line 119) -> generator parameters (via gumbel_softmax, generator.py::Line104). For the correspondence between our paper and code, please refer to this.

Sorry that I don't quite understand your question "这里是用到了前一次classifer到梯度了吗". Could you specify it more detailedly?

from learning-data-manipulation.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.