Hi again, working through my MNIST example is going quite well so far. I have reached a point now where the graph is fully constructed and I'm beginning to translate the training phase from Python. The cost function used in my book is tf.reduce_mean, I searched through the documentation and understand this specific one is not available in the C bindings. Is there any way to accomplish the same result as tf.reduce_mean using the C-bindings only?
--
You received this message because you are subscribed to the Google Groups "Rust for TensorFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rust+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/d7bd7431-d153-4826-a09f-dd9cc47b7754%40tensorflow.org.
target_output = tf.placeholder(tf.float32, [None, 10])
...
ntwk_output_1 = tf.matmul(l3_output, out_layer) + out_layer_bias
...
cf = td.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=ntwk_output_1, labels=target_output))
// raw logits
let network_output_mul = ops::mat_mul(
layer_3_output.into(),
out_layer.output().clone(),
&mut layer_scope.with_op_name("network_output_mul"),
)?;
let network_output_1 = ops::add(
network_output_mul.clone().into(),
out_layer_bias.output().clone(),
&mut layer_scope.with_op_name("network_output_1"),
)?;
let softmax_cewl = ops::softmax_cross_entropy_with_logits(
network_output_1.into(),
target_output.into(),
&mut training_scope.with_op_name("softmax_cewl"),
)?;
let cf = ops::mean(
softmax_cewl.into(),
// ?
&mut training_scope.with_op_name("cost_function"),
)?;
You can call tensorflow::ops::mean if you're using the new Scope-based graph building. Note that this currently requires the experimental_training feature. If you're using the lower-level graph building (i.e. using tensorflow::Operation), you can use the "Mean" op_type.
On Mon, May 25, 2020 at 10:29 AM 'Robert Blomqvist' via Rust for TensorFlow <ru...@tensorflow.org> wrote:
--
Hi again, working through my MNIST example is going quite well so far. I have reached a point now where the graph is fully constructed and I'm beginning to translate the training phase from Python. The cost function used in my book is tf.reduce_mean, I searched through the documentation and understand this specific one is not available in the C bindings. Is there any way to accomplish the same result as tf.reduce_mean using the C-bindings only?
You received this message because you are subscribed to the Google Groups "Rust for TensorFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ru...@tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to rust+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/36e42f00-ad04-488f-96be-6fedf70d8e45%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/36e42f00-ad04-488f-96be-6fedf70d8e45%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/36e42f00-ad04-488f-96be-6fedf70d8e45%40tensorflow.org.
Would you consider checking in the MNIST example to the rust repo? Maybe under examples/?
I think it’d be helpful for a lot of people. (Adam: would you take that patch?)
Sent from Mail for Windows 10
To unsubscribe from this group and stop receiving emails from it, send an email to rust+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/b0acbbbb-231d-442b-b0a6-3142c62928f5%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/b0acbbbb-231d-442b-b0a6-3142c62928f5%40tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to rust+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/71aa0ffa-c17c-46d1-8972-8d0a56d90707%40tensorflow.org.
ops::constant(&[INPUT_SIZE, HIDDEN_LAYER_SIZE][..], layer_scope);
layer_scope.constant(&[INPUT_SIZE, HIDDEN_LAYER_SIZE][..]);
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/71aa0ffa-c17c-46d1-8972-8d0a56d90707%40tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to rust+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/934e110a-6142-4720-b79b-fb0127119916%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/934e110a-6142-4720-b79b-fb0127119916%40tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to rust+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/8e9e62fd-691e-43d1-8924-3858c3e2383c%40tensorflow.org.