我得出无法在 cntk 中实现 'deep dream' 的结论是否正确?

Am I correct in concluding that it is not possible to implement a 'deep dream' in cntk?

我想在我拥有的一些图像数据上实现一个深沉的梦想。我决定尝试一下cntk,开始使用MNIST手写数据进行开发。

通常,在训练神经网络时,您有一些固定的输入图像集,并且有一些可变权重需要学习。 Deep dreaming 将这些翻转过来,在给定网络中的一些固定权重的情况下,您可以学习可变图像。

所以我训练了一个网络来使用卷积网络非常一致地识别图像。现在我想让它生成一些图像,所以我需要对可变输入图像进行卷积。显然 cntk 不允许这样做。以下代码演示了我遇到的错误。

def doConstantConv(inputX, W, b, redRank):
    kernel = C.constant(value = W)
    bias = C.constant(value = b)
    conv = C.convolution(kernel, inputX, strides = (2,2), reduction_rank = redRank) + bias
    return C.relu(conv)

W1 = np.reshape(np.arange(200.0, dtype = np.float32), (8,1,5,5))
b1 = np.reshape(np.arange(8.0, dtype = np.float32), (8,1,1))

someInput = C.parameter((1,28,28))
layer1 = doConstantConv(someInput, W1, b1, 1)

我收到的错误是 "Convolution currently requires the main operand to have dynamic axes"。但据我所知,可学习参数不能有动态轴。那没有意义,对吗?

那么得出cntk不能用于深度做梦的结论公平吗?有破解方法吗?

看看https://github.com/Microsoft/CNTK/blob/master/Tutorials/CNTK_205_Artistic_Style_Transfer.ipynb

您可以通过在其参数中指定 need_gradient=True 来创建可学习的输入变量。

谢谢,
埃马德