| @@ -281,6 +281,9 @@ namespace Tensorflow | |||||
| return math_ops.reduce_sum(input, axis); | return math_ops.reduce_sum(input, axis); | ||||
| } | } | ||||
| public static Tensor sigmoid<T>(T x, string name = null) | |||||
| => math_ops.sigmoid(x, name: name); | |||||
| public static Tensor sum(Tensor input, int axis, bool keep_dims = false, string name = null) | public static Tensor sum(Tensor input, int axis, bool keep_dims = false, string name = null) | ||||
| => gen_math_ops._sum(input, axis, keep_dims: keep_dims, name: name); | => gen_math_ops._sum(input, axis, keep_dims: keep_dims, name: name); | ||||
| @@ -108,6 +108,26 @@ namespace Tensorflow | |||||
| return _op.outputs[0]; | return _op.outputs[0]; | ||||
| } | } | ||||
| /// <summary> | |||||
| /// Computes sigmoid of <c>x</c> element-wise. | |||||
| /// </summary> | |||||
| /// <param name="x"> | |||||
| /// </param> | |||||
| /// <param name="name"> | |||||
| /// If specified, the created operation in the graph will be this one, otherwise it will be named 'Sigmoid'. | |||||
| /// </param> | |||||
| /// <returns> | |||||
| /// The Operation can be fetched from the resulting Tensor, by fetching the Operation property from the result. | |||||
| /// </returns> | |||||
| /// <remarks> | |||||
| /// Specifically, <c>y = 1 / (1 + exp(-x))</c>. | |||||
| /// </remarks> | |||||
| public static Tensor sigmoid(Tensor x, string name = "Sigmoid") | |||||
| { | |||||
| var op = _op_def_lib._apply_op_helper("Sigmoid", name: name, new { x }); | |||||
| return op.output; | |||||
| } | |||||
| public static Tensor sinh(Tensor x, string name = null) | public static Tensor sinh(Tensor x, string name = null) | ||||
| { | { | ||||
| var _op = _op_def_lib._apply_op_helper("Sinh", name, args: new { x }); | var _op = _op_def_lib._apply_op_helper("Sinh", name, args: new { x }); | ||||
| @@ -119,7 +119,13 @@ namespace Tensorflow | |||||
| return _may_reduce_to_scalar(keepdims, axis, m); | return _may_reduce_to_scalar(keepdims, axis, m); | ||||
| } | } | ||||
| } | } | ||||
| public static Tensor sigmoid<T>(T x, string name = null) | |||||
| { | |||||
| var x_tensor = ops.convert_to_tensor(x, name: "x"); | |||||
| return gen_math_ops.sigmoid(x_tensor, name: name); | |||||
| } | |||||
| /// <summary> | /// <summary> | ||||
| /// Returns (x - y)(x - y) element-wise. | /// Returns (x - y)(x - y) element-wise. | ||||
| /// </summary> | /// </summary> | ||||
| @@ -143,7 +143,7 @@ namespace TensorFlowNET.UnitTest | |||||
| // return self._eval_helper(tensors) | // return self._eval_helper(tensors) | ||||
| // else: | // else: | ||||
| { | { | ||||
| with(ops.get_default_session(), s => | |||||
| with(tf.Session(), s => | |||||
| { | { | ||||
| var ndarray=tensor.eval(); | var ndarray=tensor.eval(); | ||||
| if (typeof(T) == typeof(double)) | if (typeof(T) == typeof(double)) | ||||