| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5ff096c commit 04c80f3
19 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -142,13 +142,13 @@ Example runner will download all the required files like training data and model | |||
| 142 | 142 | * [Logistic Regression](test/TensorFlowNET.Examples/BasicModels/LogisticRegression.cs) | |
| 143 | 143 | * [Nearest Neighbor](test/TensorFlowNET.Examples/BasicModels/NearestNeighbor.cs) | |
| 144 | 144 | * [Naive Bayes Classification](test/TensorFlowNET.Examples/BasicModels/NaiveBayesClassifier.cs) | |
| 145 | + * [Full Connected Neural Network](test/TensorFlowNET.Examples/ImageProcess/DigitRecognitionNN.cs) | ||
| 145 | 146 | * [Image Recognition](test/TensorFlowNET.Examples/ImageProcess) | |
| 146 | 147 | * [K-means Clustering](test/TensorFlowNET.Examples/BasicModels/KMeansClustering.cs) | |
| 147 | 148 | * [NN XOR](test/TensorFlowNET.Examples/BasicModels/NeuralNetXor.cs) | |
| 148 | 149 | * [Object Detection](test/TensorFlowNET.Examples/ImageProcess/ObjectDetection.cs) | |
| 149 | 150 | * [Text Classification](test/TensorFlowNET.Examples/TextProcess/BinaryTextClassification.cs) | |
| 150 | 151 | * [CNN Text Classification](test/TensorFlowNET.Examples/TextProcess/cnn_models/VdCnn.cs) | |
| 151 | - | ||
| 152 | 152 | * [Named Entity Recognition](test/TensorFlowNET.Examples/TextProcess/NER) | |
| 153 | 153 | * [Transfer Learning for Image Classification in InceptionV3](test/TensorFlowNET.Examples/ImageProcess/RetrainImageClassifier.cs) | |
| 154 | 154 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ public Tensor __call__(Tensor x) | |||
| 40 | 40 | var dot = tf.matmul(x, W); | |
| 41 | 41 | if (this.activation != null) | |
| 42 | 42 | dot = activation.Activate(dot); | |
| 43 | - Console.WriteLine("Calling Layer \"" + name + "(" + np.array(dot.GetShape().Dimensions).ToString() + ")\" ..."); | ||
| 43 | + Console.WriteLine("Calling Layer \"" + name + "(" + np.array(dot.TensorShape.Dimensions).ToString() + ")\" ..."); | ||
| 44 | 44 | return dot; | |
| 45 | 45 | } | |
| 46 | 46 | public TensorShape __shape__() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,7 +65,7 @@ public Tensor getFlow() | |||
| 65 | 65 | #endregion | |
| 66 | 66 | ||
| 67 | 67 | #region Model Graph Form Layer Stack | |
| 68 | - var flow_shape = features.GetShape(); | ||
| 68 | + var flow_shape = features.TensorShape; | ||
| 69 | 69 | Flow = features; | |
| 70 | 70 | for (int i = 0; i < layer_stack.Count; i++) | |
| 71 | 71 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,7 @@ public static Tensor _broadcast_shape_helper(Tensor shape_x, Tensor shape_y) | |||
| 37 | 37 | ||
| 38 | 38 | public static bool has_fully_defined_shape(Tensor tensor) | |
| 39 | 39 | { | |
| 40 | - return tensor.GetShape().is_fully_defined(); | ||
| 40 | + return tensor.TensorShape.is_fully_defined(); | ||
| 41 | 41 | } | |
| 42 | 42 | } | |
| 43 | 43 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,7 +161,7 @@ protected void _maybe_build(Tensor input) | |||
| 161 | 161 | if (_dtype == TF_DataType.DtInvalid) | |
| 162 | 162 | _dtype = input.dtype; | |
| 163 | 163 | ||
| 164 | - var input_shapes = input.GetShape(); | ||
| 164 | + var input_shapes = input.TensorShape; | ||
| 165 | 165 | build(input_shapes); | |
| 166 | 166 | built = true; | |
| 167 | 167 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -118,8 +118,8 @@ public Tensor sparse_softmax_cross_entropy(Tensor labels, | |||
| 118 | 118 | if(weights > 0) | |
| 119 | 119 | { | |
| 120 | 120 | var weights_tensor = ops.convert_to_tensor(weights); | |
| 121 | - var labels_rank = labels.GetShape().NDim; | ||
| 122 | - var weights_shape = weights_tensor.GetShape(); | ||
| 121 | + var labels_rank = labels.TensorShape.NDim; | ||
| 122 | + var weights_shape = weights_tensor.TensorShape; | ||
| 123 | 123 | var weights_rank = weights_shape.NDim; | |
| 124 | 124 | ||
| 125 | 125 | if (labels_rank > -1 && weights_rank > -1) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ public _WithSpaceToBatch(TensorShape input_shape, | |||
| 18 | 18 | string data_format = null) | |
| 19 | 19 | { | |
| 20 | 20 | var dilation_rate_tensor = ops.convert_to_tensor(dilation_rate, TF_DataType.TF_INT32, name: "dilation_rate"); | |
| 21 | - var rate_shape = dilation_rate_tensor.GetShape(); | ||
| 21 | + var rate_shape = dilation_rate_tensor.TensorShape; | ||
| 22 | 22 | var num_spatial_dims = rate_shape.Dimensions[0]; | |
| 23 | 23 | int starting_spatial_dim = -1; | |
| 24 | 24 | if (!string.IsNullOrEmpty(data_format) && data_format.StartsWith("NC")) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,9 +24,9 @@ public static (Tensor, Tensor) remove_squeezable_dimensions(Tensor labels, | |||
| 24 | 24 | { | |
| 25 | 25 | predictions = ops.convert_to_tensor(predictions); | |
| 26 | 26 | labels = ops.convert_to_tensor(labels); | |
| 27 | - var predictions_shape = predictions.GetShape(); | ||
| 27 | + var predictions_shape = predictions.TensorShape; | ||
| 28 | 28 | var predictions_rank = predictions_shape.NDim; | |
| 29 | - var labels_shape = labels.GetShape(); | ||
| 29 | + var labels_shape = labels.TensorShape; | ||
| 30 | 30 | var labels_rank = labels_shape.NDim; | |
| 31 | 31 | if(labels_rank > -1 && predictions_rank > -1) | |
| 32 | 32 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,7 +83,7 @@ public static Tensor dropout_v2(Tensor x, Tensor rate, Tensor noise_shape = null | |||
| 83 | 83 | // float to be selected, hence we use a >= comparison. | |
| 84 | 84 | var keep_mask = random_tensor >= rate; | |
| 85 | 85 | var ret = x * scale * math_ops.cast(keep_mask, x.dtype); | |
| 86 | - ret.SetShape(x.GetShape()); | ||
| 86 | + ret.SetShape(x.TensorShape); | ||
| 87 | 87 | return ret; | |
| 88 | 88 | }); | |
| 89 | 89 | } | |
@@ -131,14 +131,14 @@ public static Tensor sparse_softmax_cross_entropy_with_logits(Tensor labels = nu | |||
| 131 | 131 | var precise_logits = logits.dtype == TF_DataType.TF_HALF ? math_ops.cast(logits, dtypes.float32) : logits; | |
| 132 | 132 | ||
| 133 | 133 | // Store label shape for result later. | |
| 134 | - var labels_static_shape = labels.GetShape(); | ||
| 134 | + var labels_static_shape = labels.TensorShape; | ||
| 135 | 135 | var labels_shape = array_ops.shape(labels); | |
| 136 | 136 | /*bool static_shapes_fully_defined = ( | |
| 137 | 137 | labels_static_shape.is_fully_defined() && | |
| 138 | 138 | logits.get_shape()[:-1].is_fully_defined());*/ | |
| 139 | 139 | ||
| 140 | 140 | // Check if no reshapes are required. | |
| 141 | - if(logits.GetShape().NDim == 2) | ||
| 141 | + if(logits.TensorShape.NDim == 2) | ||
| 142 | 142 | { | |
| 143 | 143 | var (cost, _) = gen_nn_ops.sparse_softmax_cross_entropy_with_logits( | |
| 144 | 144 | precise_logits, labels, name: name); | |
@@ -163,7 +163,7 @@ public static Tensor softmax_cross_entropy_with_logits_v2_helper(Tensor labels, | |||
| 163 | 163 | { | |
| 164 | 164 | var precise_logits = logits; | |
| 165 | 165 | var input_rank = array_ops.rank(precise_logits); | |
| 166 | - var shape = logits.GetShape(); | ||
| 166 | + var shape = logits.TensorShape; | ||
| 167 | 167 | ||
| 168 | 168 | if (axis != -1) | |
| 169 | 169 | throw new NotImplementedException("softmax_cross_entropy_with_logits_v2_helper axis != -1"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,8 +16,8 @@ public static Tensor broadcast_weights(Tensor weights, Tensor values) | |||
| 16 | 16 | weights, dtype: values.dtype.as_base_dtype(), name: "weights"); | |
| 17 | 17 | ||
| 18 | 18 | // Try static check for exact match. | |
| 19 | - var weights_shape = weights.GetShape(); | ||
| 20 | - var values_shape = values.GetShape(); | ||
| 19 | + var weights_shape = weights.TensorShape; | ||
| 20 | + var values_shape = values.TensorShape; | ||
| 21 | 21 | if (weights_shape.is_fully_defined() && | |
| 22 | 22 | values_shape.is_fully_defined()) | |
| 23 | 23 | return weights; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments