6

Theano ライブラリがインストールされた Python 2.7 (更新されたバージョン) を使用していますが、入力パラメーターに問題があり、Theano 関数を定義しています。

コードは次のとおりです。

    corruption_level = T.scalar('corruption')  # % of corruption to use
    learning_rate = T.scalar('lr')  # learning rate to use

    fn = theano.function(
        inputs=[
            index,
            theano.In(corruption_level, value=0.2),
            theano.In(learning_rate, value=0.1)
        ],
        outputs=cost,
        updates=updates,
        givens={
            self.x: train_set_x[batch_begin: batch_end]
        }
    )

それはここから取られた:

http://deeplearning.net/tutorial/code/SdA.py

そして、Eclipseでこのエラーが発生します:

NotImplementedError: In() instances and tuple inputs trigger the old
semantics, which disallow using updates and givens

したがって、この方法でコードを変更すると、次のようになります。

        fn = theano.function(
            inputs=[
                index,
                #theano.In(corruption_level, value=0.2),
                #theano.In(learning_rate, value=0.1)
                corruption_level,
                learning_rate
            ],
            outputs=cost,
            updates=updates,
            givens={
                self.x: train_set_x[batch_begin: batch_end]
            }
        )

動作しますが、corruption_level と learning_rate の値を渡すことができません。

誰でも助けることができますか?ありがとう!

ルカ

4

1 に答える 1