('c', {BATCH_LEN, FRAME_LEN, CLASS_LEN},
+ {
+ 0.21675213f, 0.17510113f, -0.27113008f, 0.18455505f, -0.30527824f,
+ 0.12460334f, 0.19112396f, -0.44803357f, 0.24922381f, -0.11691755f,
+ 0.16021198f, 0.27529928f, -0.28298444f, 0.21923551f, -0.37176234f,
+ 0.20386407f, 0.1236309f, -0.15528734f, 0.2693891f, -0.44159663f,
+ 0.23395306f, 0.21812534f, -0.36457074f, 0.12620285f, -0.21371071f,
+ 0.28493422f, 0.15514892f, -0.4384392f, 0.18344463f, -0.18508859f,
+ 0.19713868f, -0.61835873f, 0.22776747f, 0.13597165f, 0.05748086f,
+ 0.20409954f, -0.17006806f, 0.14958507f, 0.2825293f, -0.46614605f,
+ 0.218183f, -0.28762838f, 0.15414338f, 0.24202588f, -0.32672384f,
+ 0.09618269f, -0.40792802f, 0.15407808f, 0.18027757f, -0.02261038f,
+ -0.40063405f, -0.04311697f, 0.3049292f, 0.15634498f, -0.01752307f,
+ -0.43639395f, 0.31014743f, 0.14724013f, 0.18989684f, -0.21089047f,
+ 0.24827974f, -0.8280775f, 0.1833807f, 0.25178862f, 0.1446285f,
+ 0.15652135f, 0.05439584f, -0.5887033f, 0.17083165f, 0.20695446f,
+ 0.1825678f, 0.1605832f, -0.04697506f, 0.17088373f, -0.4670597f,
+ 0.13331066f, 0.2217448f, -0.46589473f, 0.24472642f, -0.13388708f,
+ 0.17822751f, 0.1750198f, -0.27072078f, -0.15830047f, 0.07577389f,
+ 0.16730122f, 0.19618073f, 0.23872548f, -0.618405f, 0.01619747f,
+ -0.41614607f, 0.16291247f, 0.20550671f, 0.14981383f, -0.10208681f,
+ -0.32300252f, 0.2421792f, -0.01448151f, 0.15483606f, -0.05953133f,
+ -0.03524604f, 0.1660878f, -0.24423766f, 0.19025035f, -0.07685445f,
+ 0.1546654f, 0.00699046f, -0.26606354f, 0.17164008f, -0.06723261f,
+ 0.2533586f, -0.31069174f, -0.07983261f, 0.19742766f, -0.06026195f,
+ 0.1379485f, -0.47723943f, 0.11733948f, 0.29238105f, -0.07042958
+ });
+#endif
+ sd::ops::ctc_loss_grad op;
+
+ auto results = op.evaluate({&labels, &logits, &labels_len, &logits_length}, {}, {BLANK_INDEX});
+
+ ASSERT_EQ(ND4J_STATUS_OK, results.status());
+
+ auto *gradient = results.at(0);
+
+ //gradient->printIndexedBuffer("gradient");
+
+ ASSERT_TRUE(expected.isSameShape(gradient));
+ ASSERT_TRUE(expected.equalsTo(gradient, 1.e-06));
+
+}
+
+#endif
\ No newline at end of file
diff --git a/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/ir/TensorNamespace.java b/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/ir/TensorNamespace.java
index 434bda3a8..a0899ddbe 100644
--- a/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/ir/TensorNamespace.java
+++ b/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/ir/TensorNamespace.java
@@ -5411,12 +5411,14 @@ public final class TensorNamespace {
* Serializations can either use one of the fields above, or use this
* raw bytes field. The only exception is the string case, where one is
* required to store the content in the repeated bytes string_data field.
+ *
* When this raw_data field is used to store tensor value, elements MUST
* be stored in as fixed-width, little-endian order.
* Floating-point data types MUST be stored in IEEE 754 format.
* Complex64 elements must be written as two consecutive FLOAT values, real component first.
* Complex128 elements must be written as two consecutive DOUBLE values, real component first.
* Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
+ *
* Note: the advantage of specific field rather than the raw_data field is
* that in some cases (e.g. int data), protobuf does a better packing via
* variable length storage, and may lead to smaller binary footprint.
@@ -5655,6 +5657,7 @@ public final class TensorNamespace {
/**
*
* Tensors
+ *
* A serialized tensor value.
*
*
@@ -7010,12 +7013,14 @@ public final class TensorNamespace {
* Serializations can either use one of the fields above, or use this
* raw bytes field. The only exception is the string case, where one is
* required to store the content in the repeated bytes string_data field.
+ *
* When this raw_data field is used to store tensor value, elements MUST
* be stored in as fixed-width, little-endian order.
* Floating-point data types MUST be stored in IEEE 754 format.
* Complex64 elements must be written as two consecutive FLOAT values, real component first.
* Complex128 elements must be written as two consecutive DOUBLE values, real component first.
* Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
+ *
* Note: the advantage of specific field rather than the raw_data field is
* that in some cases (e.g. int data), protobuf does a better packing via
* variable length storage, and may lead to smaller binary footprint.
@@ -7766,6 +7771,7 @@ public final class TensorNamespace {
/**
*
* Tensors
+ *
* A serialized tensor value.
*
*
@@ -9080,12 +9086,14 @@ public final class TensorNamespace {
* Serializations can either use one of the fields above, or use this
* raw bytes field. The only exception is the string case, where one is
* required to store the content in the repeated bytes string_data field.
+ *
* When this raw_data field is used to store tensor value, elements MUST
* be stored in as fixed-width, little-endian order.
* Floating-point data types MUST be stored in IEEE 754 format.
* Complex64 elements must be written as two consecutive FLOAT values, real component first.
* Complex128 elements must be written as two consecutive DOUBLE values, real component first.
* Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
+ *
* Note: the advantage of specific field rather than the raw_data field is
* that in some cases (e.g. int data), protobuf does a better packing via
* variable length storage, and may lead to smaller binary footprint.
@@ -9102,12 +9110,14 @@ public final class TensorNamespace {
* Serializations can either use one of the fields above, or use this
* raw bytes field. The only exception is the string case, where one is
* required to store the content in the repeated bytes string_data field.
+ *
* When this raw_data field is used to store tensor value, elements MUST
* be stored in as fixed-width, little-endian order.
* Floating-point data types MUST be stored in IEEE 754 format.
* Complex64 elements must be written as two consecutive FLOAT values, real component first.
* Complex128 elements must be written as two consecutive DOUBLE values, real component first.
* Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
+ *
* Note: the advantage of specific field rather than the raw_data field is
* that in some cases (e.g. int data), protobuf does a better packing via
* variable length storage, and may lead to smaller binary footprint.
@@ -9130,12 +9140,14 @@ public final class TensorNamespace {
* Serializations can either use one of the fields above, or use this
* raw bytes field. The only exception is the string case, where one is
* required to store the content in the repeated bytes string_data field.
+ *
* When this raw_data field is used to store tensor value, elements MUST
* be stored in as fixed-width, little-endian order.
* Floating-point data types MUST be stored in IEEE 754 format.
* Complex64 elements must be written as two consecutive FLOAT values, real component first.
* Complex128 elements must be written as two consecutive DOUBLE values, real component first.
* Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
+ *
* Note: the advantage of specific field rather than the raw_data field is
* that in some cases (e.g. int data), protobuf does a better packing via
* variable length storage, and may lead to smaller binary footprint.
diff --git a/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/loss/CtcLoss.java b/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/loss/CtcLoss.java
new file mode 100644
index 000000000..0b21c8aa0
--- /dev/null
+++ b/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/loss/CtcLoss.java
@@ -0,0 +1,60 @@
+/*
+ * ******************************************************************************
+ * *
+ * *
+ * * This program and the accompanying materials are made available under the
+ * * terms of the Apache License, Version 2.0 which is available at
+ * * https://www.apache.org/licenses/LICENSE-2.0.
+ * *
+ * * See the NOTICE file distributed with this work for additional
+ * * information regarding copyright ownership.
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * * License for the specific language governing permissions and limitations
+ * * under the License.
+ * *
+ * * SPDX-License-Identifier: Apache-2.0
+ * *****************************************************************************
+ */
+
+package org.nd4j.linalg.api.ops.impl.loss;
+
+import org.nd4j.autodiff.loss.LossReduce;
+import org.nd4j.autodiff.samediff.SDVariable;
+import org.nd4j.autodiff.samediff.SameDiff;
+import org.nd4j.linalg.api.ndarray.INDArray;
+import org.nd4j.linalg.api.ops.impl.loss.bp.AbsoluteDifferenceLossBp;
+
+import java.util.List;
+
+public class CtcLoss extends BaseLoss {
+
+
+ public CtcLoss(SameDiff sameDiff, LossReduce lossReduce, SDVariable predictions, SDVariable weights, SDVariable labels){
+ super(sameDiff, lossReduce, predictions, weights, labels);
+ }
+
+ public CtcLoss(SameDiff sameDiff, SDVariable label, SDVariable predictions, SDVariable weights,
+ LossReduce lossReduce) {
+ this(sameDiff, lossReduce, predictions, weights, label);
+ }
+
+ public CtcLoss(INDArray labels, INDArray predictions, INDArray weights, LossReduce lossReduce){
+ super(lossReduce, predictions, weights, labels);
+ }
+
+ public CtcLoss(){ }
+
+ @Override
+ public String opName() {
+ return "ctc_loss";
+ }
+
+ @Override
+ public List doDiff(List grad){
+ //No external gradient
+ //Args are: predictions, weights, label
+ return new AbsoluteDifferenceLossBp(sameDiff, lossReduce, arg(0), arg(1), arg(2)).outputs();
+ }
+}
diff --git a/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/loss/bp/CtcLossBp.java b/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/loss/bp/CtcLossBp.java
new file mode 100644
index 000000000..bc5b8461d
--- /dev/null
+++ b/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/loss/bp/CtcLossBp.java
@@ -0,0 +1,48 @@
+/*
+ * ******************************************************************************
+ * *
+ * *
+ * * This program and the accompanying materials are made available under the
+ * * terms of the Apache License, Version 2.0 which is available at
+ * * https://www.apache.org/licenses/LICENSE-2.0.
+ * *
+ * * See the NOTICE file distributed with this work for additional
+ * * information regarding copyright ownership.
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * * License for the specific language governing permissions and limitations
+ * * under the License.
+ * *
+ * * SPDX-License-Identifier: Apache-2.0
+ * *****************************************************************************
+ */
+
+package org.nd4j.linalg.api.ops.impl.loss.bp;
+
+import org.nd4j.autodiff.loss.LossReduce;
+import org.nd4j.autodiff.samediff.SDVariable;
+import org.nd4j.autodiff.samediff.SameDiff;
+
+import java.util.List;
+
+public class CtcLossBp extends BaseLossBp {
+
+
+ public CtcLossBp(SameDiff sameDiff, LossReduce lossReduce, SDVariable predictions, SDVariable weights, SDVariable labels){
+ super(sameDiff, lossReduce, predictions, weights, labels);
+ }
+
+ public CtcLossBp(){ }
+
+ @Override
+ public String opName() {
+ return "ctc_loss_grad";
+ }
+
+ @Override
+ public List doDiff(List grad){
+ throw new UnsupportedOperationException("Differentiation of " + getClass().getName() + " not supported");
+ }
+
+}
diff --git a/nd4j/nd4j-backends/nd4j-tests/pom.xml b/nd4j/nd4j-backends/nd4j-tests/pom.xml
index a68e9c8e7..31cb14fb5 100644
--- a/nd4j/nd4j-backends/nd4j-tests/pom.xml
+++ b/nd4j/nd4j-backends/nd4j-tests/pom.xml
@@ -391,7 +391,7 @@
For testing large zoo models, this may not be enough (so comment it out).
-->
- -Dfile.encoding=UTF-8 -Djava.library.path="${nd4j.basedir}/nd4j-backends/nd4j-backend-impls/nd4j-native/target/classes"
+ -Dfile.encoding=UTF-8 "
diff --git a/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/pom.xml b/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/pom.xml
index bec969be9..de219f99b 100644
--- a/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/pom.xml
+++ b/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/pom.xml
@@ -107,7 +107,7 @@
*.java
**/*.java