Giter VIP home page Giter VIP logo

Comments (3)

iweirman avatar iweirman commented on August 17, 2024

刚看了下,浅答一下,有什么问题的话,望大佬轻喷

paper :https://arxiv.org/pdf/2011.05864.pdf

要看懂这个论文,主要看下图1,公式4。说的很清楚了,将 BERT sentence embeddings 映射到 标准高斯分布空间。
看下这几个地方的代码:objective_towertop_prior

无监督的话主要看下model_fn_builder

from bert-flow.

guotong1988 avatar guotong1988 commented on August 17, 2024

大佬,有监督 和 无监督 的 训练目标 各是什么啊?

from bert-flow.

iweirman avatar iweirman commented on August 17, 2024

目标是一致的,无监督和有监督在这里的区别就是是否把监督学习的 loss 算进去,model_fn_builder
训练的是向量空间映射函数,假设这个函数是可逆的,增加了一个flow来学习这个函数。(上个评论已经说很清楚了)。

你具体要问的东西可能是无监督具体在学什么,应该在 objective_tower 函数。

with arg_scope(ops, init=init):
      encoder = glow_ops.encoder_decoder

      self.z, encoder_objective, self.eps, _, _ = encoder(
          "flow", x, self.hparams, eps=None, reverse=False)
      objective += encoder_objective

      self.z_top_shape = get_shape_list(self.z)
      prior_dist = self.top_prior()
      prior_objective = tf.reduce_sum(
          prior_dist.log_prob(self.z), axis=[1, 2, 3])
      #self.z_sample = prior_dist.sample()
      objective += prior_objective

    # bits per pixel
    _, h, w, c = get_shape_list(x)
    objective = -objective / (np.log(2) * h * w * c)

主要看下这几行

from bert-flow.

Related Issues (19)

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.