以下情况:
有一个运行TysFoeFund的生产服务器(C++)。那里的代码期望只有一个输入Placeholder
,它的输入与feed_dict:{'input':...}
相似。我无法更改服务器代码。我只能提供一个新的图,它必须有一个名为input
的{
使用tensorflow,我有一些代码可以创建两个范围不同的相同神经网络:
dnn1 = DNN(scope='dnn1')
dnn2 = DNN(scope='dnn2')
两个dnn都有一个输入Placeholder
:
<tf.Tensor 'dnn1/input:0' shape=(50) dtype=float32>
和
<tf.Tensor 'dnn2/input:0' shape=(50) dtype=float32>
两个网络应该得到相同的输入。
如何使张量input
同时流向图中的dnn1/input
和{DNN
类,所以最后我的图将使用dnn1/input
、dnn2/input
和{
默认情况下,您可以修改DNN占位符以使用生产输入占位符。因此,您仍然可以随时向它们提供自定义值。在
创建输入占位符并将其用作两个网络的输入:
例如DNN1:
hidden1 = (input * W1) + b1
DNN2型:
hidden1 = (input * W1) + b1
你能做到吗?在
相关问题 更多 >
编程相关推荐