使用张量流的输出函数参数化模型
Parameterized model over output functions using tensorflow
是否可以使用张量流在输出函数上建立参数化模型?如何?
示例:
我想要最后使用 softmax 函数的模型,所以
cost = tf.reduce_mean(
tf.nn.softmax_cross_entropy_with_logits(output_potentials, y))
但我想尝试 S 形输出和均方,在那种情况下:
cost = tf.reduce_sum(
tf.pow(tf.sub(tf.nn.sigmoid(output_potentials), y), 2.0))
我的问题是,如何制作具有成本函数规范的参数化模型?在为此类模型调用构造函数之前,我没有 tensorflow 占位符。
将两个函数都放在图中,然后在评估期间调用其中一个。评估框架将 select 评估期间特定版本成本所需的图表子集
cost1 = tf.reduce_mean(
tf.nn.softmax_cross_entropy_with_logits(output_potentials, y))
cost2 = tf.reduce_sum(
tf.pow(tf.sub(tf.nn.sigmoid(output_potentials), y), 2.0))
sess.run([cost1])
sess.run([cost2])
是否可以使用张量流在输出函数上建立参数化模型?如何?
示例: 我想要最后使用 softmax 函数的模型,所以
cost = tf.reduce_mean(
tf.nn.softmax_cross_entropy_with_logits(output_potentials, y))
但我想尝试 S 形输出和均方,在那种情况下:
cost = tf.reduce_sum(
tf.pow(tf.sub(tf.nn.sigmoid(output_potentials), y), 2.0))
我的问题是,如何制作具有成本函数规范的参数化模型?在为此类模型调用构造函数之前,我没有 tensorflow 占位符。
将两个函数都放在图中,然后在评估期间调用其中一个。评估框架将 select 评估期间特定版本成本所需的图表子集
cost1 = tf.reduce_mean(
tf.nn.softmax_cross_entropy_with_logits(output_potentials, y))
cost2 = tf.reduce_sum(
tf.pow(tf.sub(tf.nn.sigmoid(output_potentials), y), 2.0))
sess.run([cost1])
sess.run([cost2])