我从这里读到了卷积神经网络.然后我开始玩火炬7.我对CNN的卷积层感到困惑.
从教程中,
The neurons in a layer will only be connected to a small region of the layer before it, instead of all of the neurons in a fully-connected manner.
For example, suppose that the input volume has size [32x32x3], (e.g. an RGB CIFAR-10 image). If the receptive field is of size 5x5, then each neuron in the Conv Layer will have weights to a [5x5x3] region in the input volume, for a total of 5*5*3 …
machine-learning computer-vision neural-network torch conv-neural-network
我已经实现了这里描述的集合视图.正如您所看到的,它使用iOS 9中提供的集合视图的单元格的交互式重新排序.但问题是,我无法控制单元格的重新排序.
说细胞是这样的 -
1 2 3 4
5 6 7 8
9 10 11 12
Run Code Online (Sandbox Code Playgroud)
我想只交换单元格6和4.所以在重新排序后,单元格将是
1 2 3 6
5 4 7 8
9 10 11 12
Run Code Online (Sandbox Code Playgroud)
如果我把星巴克放在Rose Tyler之上,就会发生这种情况 -
请注意,Sarah Connor有星巴克之地.
我想控制细胞的重新排序,这样Rose Tyler和星巴克的位置就会被交换掉.
我怎么做?
我试图用tensorflow实现一个XOR门.我成功地实现了这一点,但我不完全理解为什么它有效.我在这里和这里得到了stackoverflow帖子的帮助.所以有one hot true和without one hot true输出.这是我理解的网络,以便清楚地说明问题.
我的问题#1:
注意RELU功能和Sigmoid功能.为什么我们需要(特别是RELU功能)?你可能会说,为了实现非线性.我理解如何RELU实现非线性.我从这里得到了答案.现在根据我的理解,使用RELU和不使用之间的区别RELU是这个(见图).[我测试了这个tf.nn.relu功能.输出是这样的]
现在,如果第一个函数有效,为什么不是第二个函数呢?从我的角度来看,RELU通过组合多个线性函数来实现非线性.所以两者都是线性函数(上面两个).如果第一个实现非线性,第二个也应该实现,不应该吗?问题是,没有使用RELU网络卡住的原因?
具有一个热输出的XOR门
hidden1_neuron = 10
def Network(x, weights, bias):
layer1 = tf.nn.relu(tf.matmul(x, weights['h1']) + bias['h1'])
layer_final = tf.matmul(layer1, weights['out']) + bias['out']
return layer_final
weight = {
'h1' : tf.Variable(tf.random_normal([2, hidden1_neuron])),
'out': tf.Variable(tf.random_normal([hidden1_neuron, 2]))
}
bias = {
'h1' : tf.Variable(tf.random_normal([hidden1_neuron])),
'out': tf.Variable(tf.random_normal([2]))
}
x …Run Code Online (Sandbox Code Playgroud) 我试图从这个链接中理解一个简单的Softmax分类器实现 - CS231n - 用于视觉识别的卷积神经网络.他们在这里实现了一个简单的softmax分类器.在链接上的Softmax分类器的示例中,2D空间上有随机的300个点以及与它们相关联的标签.softmax分类器将了解哪个点属于哪个类.
这是softmax分类器的完整代码.或者你可以看到我提供的链接.
# initialize parameters randomly
W = 0.01 * np.random.randn(D,K)
b = np.zeros((1,K))
# some hyperparameters
step_size = 1e-0
reg = 1e-3 # regularization strength
# gradient descent loop
num_examples = X.shape[0]
for i in xrange(200):
# evaluate class scores, [N x K]
scores = np.dot(X, W) + b
# compute the class probabilities
exp_scores = np.exp(scores)
probs = exp_scores / np.sum(exp_scores, axis=1, keepdims=True) # [N x K]
# compute the loss: average cross-entropy …Run Code Online (Sandbox Code Playgroud) machine-learning calculus gradient-descent deep-learning softmax
从reactive swift的文档中我可以理解Flattening. 可以在此处找到示例。在该部分中,Flattening event streams所有内容都已得到完美讨论。
我很困惑flatmap。根据文档,它Maps each event from self to a new producer, then flattens the resulting producers according to strategy - concat/merge/latest. 所以,它应该类似于flattening我的猜测。
但是,我无法产生类似的行为。例如,考虑以下代码段。如果我改变扁平化策略,如concat/merge/latest,输出不会改变。
let (numbersSignal, numbersObserver) = Signal<String, NoError>.pipe()
numbersSignal.producer.flatMap(.concat) { value -> SignalProducer<String, NoError> in
print("Outer Signal Producer \(value)")
return SignalProducer<String, NoError> {
observer, lifetime in
print("Inner Signal Producer \(value)")
observer.send(value: "Inner")
observer.sendCompleted()
}
}.observe(on: UIScheduler()).startWithValues { result in
print("Observer \(result)")
} …Run Code Online (Sandbox Code Playgroud)