失礼致します
python3にてchainerを用いて、Autoencoderの設計を行っています。
初学者なもので現在様々なものを参考に勉強を行っており、Autoencoderに関して以下のようなコードを見つけました。
python
1class AE(Chain): 2 def __init__(self): 3 super(AE, self).__init__( 4 l1 = L.Linear(4,2), 5 l2 = L.Linear(2,4), 6 ) 7 def __call__(self, x): 8 bv = self.fwd(x) 9 return F.mean_squared_error(bv, x) 10 11 def fwd(self, x): 12 fv = F.sigmoid(self.l1(x)) 13 bv = self.l2(fv) 14 return bv
このコードより2つの質問があります。
Q1.Autoencoderの復元層において活性化関数は必要ないのでしょうか
fwd関数でencodeとdecodeを行う際に以下のようにするのは間違いでしょうか
python
1 def fwd(self, x): 2 fv = F.sigmoid(self.l1(x)) 3 bv = F.sigmoid(self.l2(fv)) 4 return bv
Q2.Autoencoderを設計する際に別々のLinearを設計するのは良いのでしょうか
decodeを行う際に、encode時に使用した重みWの転置行列とencode時の出力をかけることにより復元をすることが、Autoencoderの定義だと思うのですが、重みWをencode,decode時に別々のものを設定するのは正しいのでしょうか。
Autoencoderについてお詳しい方がいらしましたら、お力を貸してください!!
よろしくお願い致します。
あなたの回答
tips
プレビュー