如何更改keras模型中图层的节点数
我尝试过的一种方法是使用keras functional API对层进行深度克隆,并进行所需的更改,例如:
config = layer.get_config()
units = config['units']
config['units'] = units + 1 # Add one node
clone = layer.from_config(config)
x = clone(layer.input)
outbound_layer = layer.outbound_nodes[0].outbound_layer
outbound_layer_clone = outbound_layer.from_config(outbound_layer.get_config())
outbound_layer_clone(x)
但是有没有更好的方法来解决这个问题呢
目前没有回答
相关问题 更多 >
编程相关推荐