使用tf.variable_scope('layer1-conv1'):
conv1_weights = tf.get_variable("weight",[3,3,3,32],initializer=tf.truncated_normal_initializer(stddev=0.1))
conv1_biases = tf.get_variable("bias", [32], initializer=tf.constant_initializer(0.0))
conv1 = tf.nn.conv2d(input_tensor, conv1_weights, strides=[1, 1, 1, 1], padding='SAME')
relu1 = tf.nn.relu(tf.nn.bias_add(conv1, conv1_biases))
以上述层为例,如何用sin(x)替换tf.nn.relu? tf.nn.bias_add(conv1,conv1_biases)是张量,但是math.sin()的参数是数字。希望您能对我有所帮助。谢谢!!!