tensorflow_probability: bfgs_minimize requires the elements in initial_position to have the same shape

オープン
#1,996 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python, tensorflow

調査の方向性

tensorflow_probability/python/optimizer/bfgs.py の 210 行目から始め、initial_position = [0., tf.zeros(10)] で失敗を再現します。bfgs_minimize が初期値をどのように結合するかを追跡し、形状の異なる要素に対して期待される動作を特定します。この入力で報告されている shape-mismatch エラーが発生しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

This line:
https://github.com/tensorflow/probability/blob/main/tensorflow_probability/python/optimizer/bfgs.py#L210
fails for input of the form:
initial_position = [0., tf.zeros(10)]

I am working through some simple toy examples and have a JointDistribution of the form:

def make_joint_dist(matrix):
    def joint_dist():
        intercept = yield tfd.Normal(loc=0.0, scale=1.0, name="intercept")
        coefficients = yield tfd.Normal(loc=tf.zeros(10), scale=1.0, name="coefficients")
        yield tfd.Normal(
            loc=intercept + tfl.matvec(matrix, coefficients),
            scale=1.0,
            name="observations",
        )

    return tfd.JointDistributionCoroutineAutoBatched(joint_dist)

I am trying to run bfgs_minimize to find the MAP (minimize -joint_dist.log_prob(params)). However, in this case, I am cannot figure out how to pass an input_position for the coefficients. The code fails at L210 above:
Shapes of all inputs must match: values[0].shape = [] != values[1].shape = [10]

I can put together a running example colab, but wanted to kick this off while I clean up my notebook....

主要言語
Jupyter Notebook
スター
4.4k
フォーク
1.1k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tensorflow/probability のほかの issue

tensorflow/probability の issue をすべて見る

似ている issue

Machine Learning の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。