
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
GradientTapeを使ってfitするとエラーが出た。そして解決した。 - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
GradientTapeを使ってfitするとエラーが出た。そして解決した。 - Qiita
#モデルを構築 class VAE(tf.keras.Model): def __init__(self,latent_dim): super(VAE,self).__init__(... #モデルを構築 class VAE(tf.keras.Model): def __init__(self,latent_dim): super(VAE,self).__init__() self.encoder = Encode(latent_dim) self.decoder = Decode() #lossを計算 def VAE_loss(self,x): mean,logvar,z = self.encoder(x) x_sigmoid = self.decoder(z) #reshape shape = tf.shape(x) x = tf.reshape(x,[shape[0],-1]) x_sigmoid = tf.reshape(x_sigmoid,[shape[0],-1]) #復元誤差 reconstruction_loss = tf.keras.losses.Binar