小编Jan*_*ane的帖子

keras模型输出形状中的方括号

我最近在查看模型摘要时遇到了这种情况。

在此输入图像描述

[(None, 16)]我想知道和之间有什么区别(None, 16)?为什么输入层有这样的输入形状?

来源:model.summary() 在使用子类模型时无法打印输出形状

keras

5
推荐指数
1
解决办法
1307
查看次数

'Monad(Writer String)'的非法实例声明

我试图创建自己的Writer类型,然后我也为它创建了一个实例.无论如何,我继续得到这个错误:

Illegal instance declaration for ‘Monad (Writer String)’
  (All instance types must be of the form (T a1 ... an)
   where a1 ... an are *distinct type variables*,
   and each type variable appears at most once in the instance head.
   Use FlexibleInstances if you want to disable this.)
In the instance declaration for ‘Monad (Writer String)’
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

newtype Writer log a = Writer {runWriter :: (a,log)} 
instance Monad (Writer String) where
  return a = Writer (a, "")
  ma >>= k …
Run Code Online (Sandbox Code Playgroud)

monads haskell

0
推荐指数
1
解决办法
121
查看次数

标签 统计

haskell ×1

keras ×1

monads ×1