id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
128,600
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/TransformProcess.java
TransformProcess.transformRawStringsToInputList
public List<Writable> transformRawStringsToInputList(List<String> values) { List<Writable> ret = new ArrayList<>(); if (values.size() != initialSchema.numColumns()) throw new IllegalArgumentException( String.format("Number of values %d does not match the number of input c...
java
public List<Writable> transformRawStringsToInputList(List<String> values) { List<Writable> ret = new ArrayList<>(); if (values.size() != initialSchema.numColumns()) throw new IllegalArgumentException( String.format("Number of values %d does not match the number of input c...
[ "public", "List", "<", "Writable", ">", "transformRawStringsToInputList", "(", "List", "<", "String", ">", "values", ")", "{", "List", "<", "Writable", ">", "ret", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "values", ".", "size", "(", ")"...
Based on the input schema, map raw string values to the appropriate writable @param values the values to convert @return the transformed values based on the schema
[ "Based", "on", "the", "input", "schema", "map", "raw", "string", "values", "to", "the", "appropriate", "writable" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/TransformProcess.java#L547-L581
128,601
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/pooling/KerasPoolingUtils.java
KerasPoolingUtils.mapPoolingType
public static PoolingType mapPoolingType(String className, KerasLayerConfiguration conf) throws UnsupportedKerasConfigurationException { PoolingType poolingType; if (className.equals(conf.getLAYER_CLASS_NAME_MAX_POOLING_2D()) || className.equals(conf.getLAYER_CLASS_NAME_MAX_P...
java
public static PoolingType mapPoolingType(String className, KerasLayerConfiguration conf) throws UnsupportedKerasConfigurationException { PoolingType poolingType; if (className.equals(conf.getLAYER_CLASS_NAME_MAX_POOLING_2D()) || className.equals(conf.getLAYER_CLASS_NAME_MAX_P...
[ "public", "static", "PoolingType", "mapPoolingType", "(", "String", "className", ",", "KerasLayerConfiguration", "conf", ")", "throws", "UnsupportedKerasConfigurationException", "{", "PoolingType", "poolingType", ";", "if", "(", "className", ".", "equals", "(", "conf", ...
Map Keras pooling layers to DL4J pooling types. @param className name of the Keras pooling class @return DL4J pooling type @throws UnsupportedKerasConfigurationException Unsupported Keras config
[ "Map", "Keras", "pooling", "layers", "to", "DL4J", "pooling", "types", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/pooling/KerasPoolingUtils.java#L37-L56
128,602
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/pooling/KerasPoolingUtils.java
KerasPoolingUtils.mapGlobalPoolingDimensions
public static int[] mapGlobalPoolingDimensions(String className, KerasLayerConfiguration conf) throws UnsupportedKerasConfigurationException { int[] dimensions; if (className.equals(conf.getLAYER_CLASS_NAME_GLOBAL_MAX_POOLING_1D()) || className.equals(conf.getLAYER_CLASS_NAME...
java
public static int[] mapGlobalPoolingDimensions(String className, KerasLayerConfiguration conf) throws UnsupportedKerasConfigurationException { int[] dimensions; if (className.equals(conf.getLAYER_CLASS_NAME_GLOBAL_MAX_POOLING_1D()) || className.equals(conf.getLAYER_CLASS_NAME...
[ "public", "static", "int", "[", "]", "mapGlobalPoolingDimensions", "(", "String", "className", ",", "KerasLayerConfiguration", "conf", ")", "throws", "UnsupportedKerasConfigurationException", "{", "int", "[", "]", "dimensions", ";", "if", "(", "className", ".", "equ...
Map Keras pooling layers to DL4J pooling dimensions. @param className name of the Keras pooling class @return pooling dimensions as int array @throws UnsupportedKerasConfigurationException Unsupported Keras config
[ "Map", "Keras", "pooling", "layers", "to", "DL4J", "pooling", "dimensions", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/pooling/KerasPoolingUtils.java#L65-L81
128,603
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/ui/HtmlSequencePlotting.java
HtmlSequencePlotting.createHtmlSequencePlotFile
public static void createHtmlSequencePlotFile(String title, Schema schema, List<List<Writable>> sequence, File output) throws Exception { String s = createHtmlSequencePlots(title, schema, sequence); FileUtils.writeStringToFile(output, s, StandardCharsets.UTF_8); }
java
public static void createHtmlSequencePlotFile(String title, Schema schema, List<List<Writable>> sequence, File output) throws Exception { String s = createHtmlSequencePlots(title, schema, sequence); FileUtils.writeStringToFile(output, s, StandardCharsets.UTF_8); }
[ "public", "static", "void", "createHtmlSequencePlotFile", "(", "String", "title", ",", "Schema", "schema", ",", "List", "<", "List", "<", "Writable", ">", ">", "sequence", ",", "File", "output", ")", "throws", "Exception", "{", "String", "s", "=", "createHtm...
Create a HTML file with plots for the given sequence and write it to a file. @param title Title of the page @param schema Schema for the data @param sequence Sequence to plot
[ "Create", "a", "HTML", "file", "with", "plots", "for", "the", "given", "sequence", "and", "write", "it", "to", "a", "file", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/ui/HtmlSequencePlotting.java#L207-L211
128,604
deeplearning4j/deeplearning4j
datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/transform/RandomCropTransform.java
RandomCropTransform.doTransform
@Override protected ImageWritable doTransform(ImageWritable image, Random random) { if (image == null) { return null; } // ensure that transform is valid if (image.getFrame().imageHeight < outputHeight || image.getFrame().imageWidth < outputWidth) throw new Un...
java
@Override protected ImageWritable doTransform(ImageWritable image, Random random) { if (image == null) { return null; } // ensure that transform is valid if (image.getFrame().imageHeight < outputHeight || image.getFrame().imageWidth < outputWidth) throw new Un...
[ "@", "Override", "protected", "ImageWritable", "doTransform", "(", "ImageWritable", "image", ",", "Random", "random", ")", "{", "if", "(", "image", "==", "null", ")", "{", "return", "null", ";", "}", "// ensure that transform is valid", "if", "(", "image", "."...
Takes an image and returns a randomly cropped image. @param image to transform, null == end of stream @param random object to use (or null for deterministic) @return transformed image
[ "Takes", "an", "image", "and", "returns", "a", "randomly", "cropped", "image", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/transform/RandomCropTransform.java#L74-L100
128,605
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/TimeSeriesUtils.java
TimeSeriesUtils.movingAverage
public static INDArray movingAverage(INDArray toAvg, int n) { INDArray ret = Nd4j.cumsum(toAvg); INDArrayIndex[] ends = new INDArrayIndex[] {NDArrayIndex.interval(n, toAvg.columns())}; INDArrayIndex[] begins = new INDArrayIndex[] {NDArrayIndex.interval(0, toAvg.columns() - n, false)}; IN...
java
public static INDArray movingAverage(INDArray toAvg, int n) { INDArray ret = Nd4j.cumsum(toAvg); INDArrayIndex[] ends = new INDArrayIndex[] {NDArrayIndex.interval(n, toAvg.columns())}; INDArrayIndex[] begins = new INDArrayIndex[] {NDArrayIndex.interval(0, toAvg.columns() - n, false)}; IN...
[ "public", "static", "INDArray", "movingAverage", "(", "INDArray", "toAvg", ",", "int", "n", ")", "{", "INDArray", "ret", "=", "Nd4j", ".", "cumsum", "(", "toAvg", ")", ";", "INDArrayIndex", "[", "]", "ends", "=", "new", "INDArrayIndex", "[", "]", "{", ...
Calculate a moving average given the length @param toAvg the array to average @param n the length of the moving window @return the moving averages for each row
[ "Calculate", "a", "moving", "average", "given", "the", "length" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/TimeSeriesUtils.java#L49-L56
128,606
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/utils/AllocationUtils.java
AllocationUtils.buildAllocationShape
public static AllocationShape buildAllocationShape(DataBuffer buffer) { AllocationShape shape = new AllocationShape(); shape.setDataType(buffer.dataType()); shape.setLength(buffer.length()); return shape; }
java
public static AllocationShape buildAllocationShape(DataBuffer buffer) { AllocationShape shape = new AllocationShape(); shape.setDataType(buffer.dataType()); shape.setLength(buffer.length()); return shape; }
[ "public", "static", "AllocationShape", "buildAllocationShape", "(", "DataBuffer", "buffer", ")", "{", "AllocationShape", "shape", "=", "new", "AllocationShape", "(", ")", ";", "shape", ".", "setDataType", "(", "buffer", ".", "dataType", "(", ")", ")", ";", "sh...
This method returns AllocationShape for the whole DataBuffer. @param buffer @return
[ "This", "method", "returns", "AllocationShape", "for", "the", "whole", "DataBuffer", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/utils/AllocationUtils.java#L68-L74
128,607
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java
AnalyzeSpark.sampleFromColumn
public static List<Writable> sampleFromColumn(int count, String columnName, Schema schema, JavaRDD<List<Writable>> data) { int colIdx = schema.getIndexOfColumn(columnName); JavaRDD<Writable> ithColumn = data.map(new SelectColumnFunction(colIdx)); return ithColumn.takeSample(...
java
public static List<Writable> sampleFromColumn(int count, String columnName, Schema schema, JavaRDD<List<Writable>> data) { int colIdx = schema.getIndexOfColumn(columnName); JavaRDD<Writable> ithColumn = data.map(new SelectColumnFunction(colIdx)); return ithColumn.takeSample(...
[ "public", "static", "List", "<", "Writable", ">", "sampleFromColumn", "(", "int", "count", ",", "String", "columnName", ",", "Schema", "schema", ",", "JavaRDD", "<", "List", "<", "Writable", ">", ">", "data", ")", "{", "int", "colIdx", "=", "schema", "."...
Randomly sample values from a single column @param count Number of values to sample @param columnName Name of the column to sample from @param schema Schema @param data Data to sample from @return A list of random samples
[ "Randomly", "sample", "values", "from", "a", "single", "column" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L164-L170
128,608
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java
AnalyzeSpark.sample
public static List<List<Writable>> sample(int count, JavaRDD<List<Writable>> data) { return data.takeSample(false, count); }
java
public static List<List<Writable>> sample(int count, JavaRDD<List<Writable>> data) { return data.takeSample(false, count); }
[ "public", "static", "List", "<", "List", "<", "Writable", ">", ">", "sample", "(", "int", "count", ",", "JavaRDD", "<", "List", "<", "Writable", ">", ">", "data", ")", "{", "return", "data", ".", "takeSample", "(", "false", ",", "count", ")", ";", ...
Randomly sample a set of examples @param count Number of samples to generate @param data Data to sample from @return Samples
[ "Randomly", "sample", "a", "set", "of", "examples" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L256-L258
128,609
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java
AnalyzeSpark.sampleSequence
public static List<List<List<Writable>>> sampleSequence(int count, JavaRDD<List<List<Writable>>> data) { return data.takeSample(false, count); }
java
public static List<List<List<Writable>>> sampleSequence(int count, JavaRDD<List<List<Writable>>> data) { return data.takeSample(false, count); }
[ "public", "static", "List", "<", "List", "<", "List", "<", "Writable", ">", ">", ">", "sampleSequence", "(", "int", "count", ",", "JavaRDD", "<", "List", "<", "List", "<", "Writable", ">", ">", ">", "data", ")", "{", "return", "data", ".", "takeSampl...
Randomly sample a number of sequences from the data @param count Number of sequences to sample @param data Data to sample from @return Sequence samples
[ "Randomly", "sample", "a", "number", "of", "sequences", "from", "the", "data" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L266-L268
128,610
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java
AnalyzeSpark.sampleMostFrequentFromColumn
public static Map<Writable, Long> sampleMostFrequentFromColumn(int nMostFrequent, String columnName, Schema schema, JavaRDD<List<Writable>> data) { int columnIdx = schema.getIndexOfColumn(columnName); JavaPairRDD<Writable, Long> keyedByWritable = data.mapToPair(new ColumnToKeyPairTr...
java
public static Map<Writable, Long> sampleMostFrequentFromColumn(int nMostFrequent, String columnName, Schema schema, JavaRDD<List<Writable>> data) { int columnIdx = schema.getIndexOfColumn(columnName); JavaPairRDD<Writable, Long> keyedByWritable = data.mapToPair(new ColumnToKeyPairTr...
[ "public", "static", "Map", "<", "Writable", ",", "Long", ">", "sampleMostFrequentFromColumn", "(", "int", "nMostFrequent", ",", "String", "columnName", ",", "Schema", "schema", ",", "JavaRDD", "<", "List", "<", "Writable", ">", ">", "data", ")", "{", "int", ...
Sample the N most frequently occurring values in the specified column @param nMostFrequent Top N values to sample @param columnName Name of the column to sample from @param schema Schema of the data @param data RDD containing the data @return List of the most frequently o...
[ "Sample", "the", "N", "most", "frequently", "occurring", "values", "in", "the", "specified", "column" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L366-L385
128,611
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java
AnalyzeSpark.min
public static Writable min(JavaRDD<List<Writable>> allData, String columnName, Schema schema){ int columnIdx = schema.getIndexOfColumn(columnName); JavaRDD<Writable> col = allData.map(new SelectColumnFunction(columnIdx)); return col.min(Comparators.forType(schema.getType(columnName).getWritableT...
java
public static Writable min(JavaRDD<List<Writable>> allData, String columnName, Schema schema){ int columnIdx = schema.getIndexOfColumn(columnName); JavaRDD<Writable> col = allData.map(new SelectColumnFunction(columnIdx)); return col.min(Comparators.forType(schema.getType(columnName).getWritableT...
[ "public", "static", "Writable", "min", "(", "JavaRDD", "<", "List", "<", "Writable", ">", ">", "allData", ",", "String", "columnName", ",", "Schema", "schema", ")", "{", "int", "columnIdx", "=", "schema", ".", "getIndexOfColumn", "(", "columnName", ")", ";...
Get the minimum value for the specified column @param allData All data @param columnName Name of the column to get the minimum value for @param schema Schema of the data @return Minimum value for the column
[ "Get", "the", "minimum", "value", "for", "the", "specified", "column" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L395-L399
128,612
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.precision
public static double precision(long tpCount, long fpCount, double edgeCase) { //Edge case if (tpCount == 0 && fpCount == 0) { return edgeCase; } return tpCount / (double) (tpCount + fpCount); }
java
public static double precision(long tpCount, long fpCount, double edgeCase) { //Edge case if (tpCount == 0 && fpCount == 0) { return edgeCase; } return tpCount / (double) (tpCount + fpCount); }
[ "public", "static", "double", "precision", "(", "long", "tpCount", ",", "long", "fpCount", ",", "double", "edgeCase", ")", "{", "//Edge case", "if", "(", "tpCount", "==", "0", "&&", "fpCount", "==", "0", ")", "{", "return", "edgeCase", ";", "}", "return"...
Calculate the precision from true positive and false positive counts @param tpCount True positive count @param fpCount False positive count @param edgeCase Edge case value use to avoid 0/0 @return Precision
[ "Calculate", "the", "precision", "from", "true", "positive", "and", "false", "positive", "counts" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L41-L48
128,613
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.recall
public static double recall(long tpCount, long fnCount, double edgeCase) { //Edge case if (tpCount == 0 && fnCount == 0) { return edgeCase; } return tpCount / (double) (tpCount + fnCount); }
java
public static double recall(long tpCount, long fnCount, double edgeCase) { //Edge case if (tpCount == 0 && fnCount == 0) { return edgeCase; } return tpCount / (double) (tpCount + fnCount); }
[ "public", "static", "double", "recall", "(", "long", "tpCount", ",", "long", "fnCount", ",", "double", "edgeCase", ")", "{", "//Edge case", "if", "(", "tpCount", "==", "0", "&&", "fnCount", "==", "0", ")", "{", "return", "edgeCase", ";", "}", "return", ...
Calculate the recall from true positive and false negative counts @param tpCount True positive count @param fnCount False negative count @param edgeCase Edge case values used to avoid 0/0 @return Recall
[ "Calculate", "the", "recall", "from", "true", "positive", "and", "false", "negative", "counts" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L58-L65
128,614
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.falsePositiveRate
public static double falsePositiveRate(long fpCount, long tnCount, double edgeCase) { //Edge case if (fpCount == 0 && tnCount == 0) { return edgeCase; } return fpCount / (double) (fpCount + tnCount); }
java
public static double falsePositiveRate(long fpCount, long tnCount, double edgeCase) { //Edge case if (fpCount == 0 && tnCount == 0) { return edgeCase; } return fpCount / (double) (fpCount + tnCount); }
[ "public", "static", "double", "falsePositiveRate", "(", "long", "fpCount", ",", "long", "tnCount", ",", "double", "edgeCase", ")", "{", "//Edge case", "if", "(", "fpCount", "==", "0", "&&", "tnCount", "==", "0", ")", "{", "return", "edgeCase", ";", "}", ...
Calculate the false positive rate from the false positive count and true negative count @param fpCount False positive count @param tnCount True negative count @param edgeCase Edge case values are used to avoid 0/0 @return False positive rate
[ "Calculate", "the", "false", "positive", "rate", "from", "the", "false", "positive", "count", "and", "true", "negative", "count" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L75-L81
128,615
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.falseNegativeRate
public static double falseNegativeRate(long fnCount, long tpCount, double edgeCase) { //Edge case if (fnCount == 0 && tpCount == 0) { return edgeCase; } return fnCount / (double) (fnCount + tpCount); }
java
public static double falseNegativeRate(long fnCount, long tpCount, double edgeCase) { //Edge case if (fnCount == 0 && tpCount == 0) { return edgeCase; } return fnCount / (double) (fnCount + tpCount); }
[ "public", "static", "double", "falseNegativeRate", "(", "long", "fnCount", ",", "long", "tpCount", ",", "double", "edgeCase", ")", "{", "//Edge case", "if", "(", "fnCount", "==", "0", "&&", "tpCount", "==", "0", ")", "{", "return", "edgeCase", ";", "}", ...
Calculate the false negative rate from the false negative counts and true positive count @param fnCount False negative count @param tpCount True positive count @param edgeCase Edge case value to use to avoid 0/0 @return False negative rate
[ "Calculate", "the", "false", "negative", "rate", "from", "the", "false", "negative", "counts", "and", "true", "positive", "count" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L91-L98
128,616
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.fBeta
public static double fBeta(double beta, long tp, long fp, long fn) { double prec = tp / ((double) tp + fp); double recall = tp / ((double) tp + fn); return fBeta(beta, prec, recall); }
java
public static double fBeta(double beta, long tp, long fp, long fn) { double prec = tp / ((double) tp + fp); double recall = tp / ((double) tp + fn); return fBeta(beta, prec, recall); }
[ "public", "static", "double", "fBeta", "(", "double", "beta", ",", "long", "tp", ",", "long", "fp", ",", "long", "fn", ")", "{", "double", "prec", "=", "tp", "/", "(", "(", "double", ")", "tp", "+", "fp", ")", ";", "double", "recall", "=", "tp", ...
Calculate the F beta value from counts @param beta Beta of value to use @param tp True positive count @param fp False positive count @param fn False negative count @return F beta
[ "Calculate", "the", "F", "beta", "value", "from", "counts" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L109-L113
128,617
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.fBeta
public static double fBeta(double beta, double precision, double recall) { if (precision == 0.0 || recall == 0.0) return 0; double numerator = (1 + beta * beta) * precision * recall; double denominator = beta * beta * precision + recall; return numerator / denominator; ...
java
public static double fBeta(double beta, double precision, double recall) { if (precision == 0.0 || recall == 0.0) return 0; double numerator = (1 + beta * beta) * precision * recall; double denominator = beta * beta * precision + recall; return numerator / denominator; ...
[ "public", "static", "double", "fBeta", "(", "double", "beta", ",", "double", "precision", ",", "double", "recall", ")", "{", "if", "(", "precision", "==", "0.0", "||", "recall", "==", "0.0", ")", "return", "0", ";", "double", "numerator", "=", "(", "1"...
Calculate the F-beta value from precision and recall @param beta Beta value to use @param precision Precision @param recall Recall @return F-beta value
[ "Calculate", "the", "F", "-", "beta", "value", "from", "precision", "and", "recall" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L123-L131
128,618
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.matthewsCorrelation
public static double matthewsCorrelation(long tp, long fp, long fn, long tn) { double numerator = ((double) tp) * tn - ((double) fp) * fn; double denominator = Math.sqrt(((double) tp + fp) * (tp + fn) * (tn + fp) * (tn + fn)); return numerator / denominator; }
java
public static double matthewsCorrelation(long tp, long fp, long fn, long tn) { double numerator = ((double) tp) * tn - ((double) fp) * fn; double denominator = Math.sqrt(((double) tp + fp) * (tp + fn) * (tn + fp) * (tn + fn)); return numerator / denominator; }
[ "public", "static", "double", "matthewsCorrelation", "(", "long", "tp", ",", "long", "fp", ",", "long", "fn", ",", "long", "tn", ")", "{", "double", "numerator", "=", "(", "(", "double", ")", "tp", ")", "*", "tn", "-", "(", "(", "double", ")", "fp"...
Calculate the binary Matthews correlation coefficient from counts @param tp True positive count @param fp False positive counts @param fn False negative counts @param tn True negative count @return Matthews correlation coefficient
[ "Calculate", "the", "binary", "Matthews", "correlation", "coefficient", "from", "counts" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L153-L157
128,619
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/graphmapper/tf/TFGraphMapper.java
TFGraphMapper.nodesForIf
public IfImportState nodesForIf(NodeDef from, GraphDef graph) { //Assume we start with a switch statement int currNodeIndex = graph.getNodeList().indexOf(from); val trueDefName = from.getInput(1); val falseDefName = from.getInput(0); val scopeId = UUID.randomUUID().toString(); ...
java
public IfImportState nodesForIf(NodeDef from, GraphDef graph) { //Assume we start with a switch statement int currNodeIndex = graph.getNodeList().indexOf(from); val trueDefName = from.getInput(1); val falseDefName = from.getInput(0); val scopeId = UUID.randomUUID().toString(); ...
[ "public", "IfImportState", "nodesForIf", "(", "NodeDef", "from", ",", "GraphDef", "graph", ")", "{", "//Assume we start with a switch statement", "int", "currNodeIndex", "=", "graph", ".", "getNodeList", "(", ")", ".", "indexOf", "(", "from", ")", ";", "val", "t...
Returns the node for an if statement @param from the starting node (a merge node that represents a conditional) @param graph the graph to search @return an import state representing the nodes for each scope
[ "Returns", "the", "node", "for", "an", "if", "statement" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/graphmapper/tf/TFGraphMapper.java#L1320-L1408
128,620
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java
SDRNN.gru
public List<SDVariable> gru(GRUCellConfiguration configuration) { GRUCell c = new GRUCell(sd, configuration); return Arrays.asList(c.outputVariables()); }
java
public List<SDVariable> gru(GRUCellConfiguration configuration) { GRUCell c = new GRUCell(sd, configuration); return Arrays.asList(c.outputVariables()); }
[ "public", "List", "<", "SDVariable", ">", "gru", "(", "GRUCellConfiguration", "configuration", ")", "{", "GRUCell", "c", "=", "new", "GRUCell", "(", "sd", ",", "configuration", ")", ";", "return", "Arrays", ".", "asList", "(", "c", ".", "outputVariables", ...
The gru cell @param configuration the configuration to use @return
[ "The", "gru", "cell" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java#L31-L34
128,621
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java
SDRNN.sru
public SDVariable sru(String baseName, SRUConfiguration configuration) { return new SRU(sd, configuration).outputVariables(baseName)[0]; }
java
public SDVariable sru(String baseName, SRUConfiguration configuration) { return new SRU(sd, configuration).outputVariables(baseName)[0]; }
[ "public", "SDVariable", "sru", "(", "String", "baseName", ",", "SRUConfiguration", "configuration", ")", "{", "return", "new", "SRU", "(", "sd", ",", "configuration", ")", ".", "outputVariables", "(", "baseName", ")", "[", "0", "]", ";", "}" ]
Simiple recurrent unit @param baseName the base name to use for output variables @param configuration the configuration for the sru @return
[ "Simiple", "recurrent", "unit" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java#L87-L89
128,622
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java
SDRNN.sruCell
public SDVariable sruCell(String baseName, SRUCellConfiguration configuration) { return new SRUCell(sd, configuration).outputVariables(baseName)[0]; }
java
public SDVariable sruCell(String baseName, SRUCellConfiguration configuration) { return new SRUCell(sd, configuration).outputVariables(baseName)[0]; }
[ "public", "SDVariable", "sruCell", "(", "String", "baseName", ",", "SRUCellConfiguration", "configuration", ")", "{", "return", "new", "SRUCell", "(", "sd", ",", "configuration", ")", ".", "outputVariables", "(", "baseName", ")", "[", "0", "]", ";", "}" ]
An sru cell @param baseName the base name to use for the output variables @param configuration the configuration for the sru cell @return
[ "An", "sru", "cell" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java#L108-L110
128,623
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/OutputLayerUtil.java
OutputLayerUtil.validateOutputLayerForClassifierEvaluation
public static void validateOutputLayerForClassifierEvaluation(Layer outputLayer, Class<? extends IEvaluation> classifierEval){ if(outputLayer instanceof Yolo2OutputLayer){ throw new IllegalStateException("Classifier evaluation using " + classifierEval.getSimpleName() + " class cannot be applied for ...
java
public static void validateOutputLayerForClassifierEvaluation(Layer outputLayer, Class<? extends IEvaluation> classifierEval){ if(outputLayer instanceof Yolo2OutputLayer){ throw new IllegalStateException("Classifier evaluation using " + classifierEval.getSimpleName() + " class cannot be applied for ...
[ "public", "static", "void", "validateOutputLayerForClassifierEvaluation", "(", "Layer", "outputLayer", ",", "Class", "<", "?", "extends", "IEvaluation", ">", "classifierEval", ")", "{", "if", "(", "outputLayer", "instanceof", "Yolo2OutputLayer", ")", "{", "throw", "...
Validates if the output layer configuration is valid for classifier evaluation. This is used to try and catch invalid evaluation - i.e., trying to use classifier evaluation on a regression model. This method won't catch all possible invalid cases, but should catch some common problems. @param outputLayer Outp...
[ "Validates", "if", "the", "output", "layer", "configuration", "is", "valid", "for", "classifier", "evaluation", ".", "This", "is", "used", "to", "try", "and", "catch", "invalid", "evaluation", "-", "i", ".", "e", ".", "trying", "to", "use", "classifier", "...
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/OutputLayerUtil.java#L173-L193
128,624
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/BalanceMinibatches.java
BalanceMinibatches.balance
public void balance() { if (!rootDir.exists()) rootDir.mkdirs(); if (!rootSaveDir.exists()) rootSaveDir.mkdirs(); if (paths == null) paths = Maps.newHashMap(); if (labelRootDirs == null) labelRootDirs = Lists.newArrayList(); for (...
java
public void balance() { if (!rootDir.exists()) rootDir.mkdirs(); if (!rootSaveDir.exists()) rootSaveDir.mkdirs(); if (paths == null) paths = Maps.newHashMap(); if (labelRootDirs == null) labelRootDirs = Lists.newArrayList(); for (...
[ "public", "void", "balance", "(", ")", "{", "if", "(", "!", "rootDir", ".", "exists", "(", ")", ")", "rootDir", ".", "mkdirs", "(", ")", ";", "if", "(", "!", "rootSaveDir", ".", "exists", "(", ")", ")", "rootSaveDir", ".", "mkdirs", "(", ")", ";"...
Generate a balanced dataset minibatch fileset.
[ "Generate", "a", "balanced", "dataset", "minibatch", "fileset", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/BalanceMinibatches.java#L53-L117
128,625
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp-java8/src/main/java/org/deeplearning4j/spark/models/paragraphvectors/SparkParagraphVectors.java
SparkParagraphVectors.fitMultipleFiles
public void fitMultipleFiles(JavaPairRDD<String, String> documentsRdd) { /* All we want here, is to transform JavaPairRDD into JavaRDD<Sequence<VocabWord>> */ validateConfiguration(); broadcastEnvironment(new JavaSparkContext(documentsRdd.context())); JavaRDD<Seque...
java
public void fitMultipleFiles(JavaPairRDD<String, String> documentsRdd) { /* All we want here, is to transform JavaPairRDD into JavaRDD<Sequence<VocabWord>> */ validateConfiguration(); broadcastEnvironment(new JavaSparkContext(documentsRdd.context())); JavaRDD<Seque...
[ "public", "void", "fitMultipleFiles", "(", "JavaPairRDD", "<", "String", ",", "String", ">", "documentsRdd", ")", "{", "/*\n All we want here, is to transform JavaPairRDD into JavaRDD<Sequence<VocabWord>>\n */", "validateConfiguration", "(", ")", ";", "broadcas...
This method builds ParagraphVectors model, expecting JavaPairRDD with key as label, and value as document-in-a-string. @param documentsRdd
[ "This", "method", "builds", "ParagraphVectors", "model", "expecting", "JavaPairRDD", "with", "key", "as", "label", "and", "value", "as", "document", "-", "in", "-", "a", "-", "string", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp-java8/src/main/java/org/deeplearning4j/spark/models/paragraphvectors/SparkParagraphVectors.java#L60-L72
128,626
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/abstracts/DummyWorkspace.java
DummyWorkspace.alloc
@Override public PagedPointer alloc(long requiredMemory, MemoryKind kind, DataType dataType, boolean initialize) { throw new UnsupportedOperationException("DummyWorkspace shouldn't be used for allocation"); }
java
@Override public PagedPointer alloc(long requiredMemory, MemoryKind kind, DataType dataType, boolean initialize) { throw new UnsupportedOperationException("DummyWorkspace shouldn't be used for allocation"); }
[ "@", "Override", "public", "PagedPointer", "alloc", "(", "long", "requiredMemory", ",", "MemoryKind", "kind", ",", "DataType", "dataType", ",", "boolean", "initialize", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"DummyWorkspace shouldn't be used f...
This method does allocation from a given Workspace @param requiredMemory allocation size, in bytes @param kind MemoryKind for allocation @param dataType dataType that is going to be used @param initialize @return
[ "This", "method", "does", "allocation", "from", "a", "given", "Workspace" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/abstracts/DummyWorkspace.java#L96-L99
128,627
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/abstracts/DummyWorkspace.java
DummyWorkspace.notifyScopeEntered
@Override public MemoryWorkspace notifyScopeEntered() { parentWorkspace = Nd4j.getMemoryManager().getCurrentWorkspace(); Nd4j.getMemoryManager().setCurrentWorkspace(null); return this; }
java
@Override public MemoryWorkspace notifyScopeEntered() { parentWorkspace = Nd4j.getMemoryManager().getCurrentWorkspace(); Nd4j.getMemoryManager().setCurrentWorkspace(null); return this; }
[ "@", "Override", "public", "MemoryWorkspace", "notifyScopeEntered", "(", ")", "{", "parentWorkspace", "=", "Nd4j", ".", "getMemoryManager", "(", ")", ".", "getCurrentWorkspace", "(", ")", ";", "Nd4j", ".", "getMemoryManager", "(", ")", ".", "setCurrentWorkspace", ...
This method notifies given Workspace that new use cycle is starting now @return
[ "This", "method", "notifies", "given", "Workspace", "that", "new", "use", "cycle", "is", "starting", "now" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/abstracts/DummyWorkspace.java#L111-L117
128,628
deeplearning4j/deeplearning4j
nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/logic/completion/Clipboard.java
Clipboard.nextCandidate
public VoidAggregation nextCandidate() { VoidAggregation result = completedQueue.poll(); // removing aggregation from tracking table if (result != null) { completedCounter.decrementAndGet(); unpin(result.getOriginatorId(), result.getTaskId()); } return r...
java
public VoidAggregation nextCandidate() { VoidAggregation result = completedQueue.poll(); // removing aggregation from tracking table if (result != null) { completedCounter.decrementAndGet(); unpin(result.getOriginatorId(), result.getTaskId()); } return r...
[ "public", "VoidAggregation", "nextCandidate", "(", ")", "{", "VoidAggregation", "result", "=", "completedQueue", ".", "poll", "(", ")", ";", "// removing aggregation from tracking table", "if", "(", "result", "!=", "null", ")", "{", "completedCounter", ".", "decreme...
This method returns one of available aggregations, if there's at least 1 ready. @return
[ "This", "method", "returns", "one", "of", "available", "aggregations", "if", "there", "s", "at", "least", "1", "ready", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/logic/completion/Clipboard.java#L118-L128
128,629
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.yield
private List<String> yield(List<String> labels) { labels.add(label); for (Tree t : children()) { labels.addAll(t.yield()); } return labels; }
java
private List<String> yield(List<String> labels) { labels.add(label); for (Tree t : children()) { labels.addAll(t.yield()); } return labels; }
[ "private", "List", "<", "String", ">", "yield", "(", "List", "<", "String", ">", "labels", ")", "{", "labels", ".", "add", "(", "label", ")", ";", "for", "(", "Tree", "t", ":", "children", "(", ")", ")", "{", "labels", ".", "addAll", "(", "t", ...
Returns the list of labels for this node and all of its children recursively @param labels the labels to add to @return the list of labels for this node and all of its children recursively
[ "Returns", "the", "list", "of", "labels", "for", "this", "node", "and", "all", "of", "its", "children", "recursively" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L104-L110
128,630
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.isPreTerminal
public boolean isPreTerminal() { if (children == null && label != null && !label.equals("TOP")) children = new ArrayList<>(); if (children != null && children.size() == 1) { Tree child = children.get(0); return child != null && child.isLeaf(); } return...
java
public boolean isPreTerminal() { if (children == null && label != null && !label.equals("TOP")) children = new ArrayList<>(); if (children != null && children.size() == 1) { Tree child = children.get(0); return child != null && child.isLeaf(); } return...
[ "public", "boolean", "isPreTerminal", "(", ")", "{", "if", "(", "children", "==", "null", "&&", "label", "!=", "null", "&&", "!", "label", ".", "equals", "(", "\"TOP\"", ")", ")", "children", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", ...
Node has one child that is a leaf @return whether the node has one child and the child is a leaf
[ "Node", "has", "one", "child", "that", "is", "a", "leaf" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L160-L168
128,631
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.depth
public int depth() { if (isLeaf()) { return 0; } int maxDepth = 0; List<Tree> kids = children(); for (Tree kid : kids) { int curDepth = kid.depth(); if (curDepth > maxDepth) { maxDepth = curDepth; } } ...
java
public int depth() { if (isLeaf()) { return 0; } int maxDepth = 0; List<Tree> kids = children(); for (Tree kid : kids) { int curDepth = kid.depth(); if (curDepth > maxDepth) { maxDepth = curDepth; } } ...
[ "public", "int", "depth", "(", ")", "{", "if", "(", "isLeaf", "(", ")", ")", "{", "return", "0", ";", "}", "int", "maxDepth", "=", "0", ";", "List", "<", "Tree", ">", "kids", "=", "children", "(", ")", ";", "for", "(", "Tree", "kid", ":", "ki...
Finds the channels of the tree. The channels is defined as the length of the longest path from this node to a leaf node. Leaf nodes have channels zero. POS tags have channels 1. Phrasal nodes have channels &gt;= 2. @return the channels
[ "Finds", "the", "channels", "of", "the", "tree", ".", "The", "channels", "is", "defined", "as", "the", "length", "of", "the", "longest", "path", "from", "this", "node", "to", "a", "leaf", "node", ".", "Leaf", "nodes", "have", "channels", "zero", ".", "...
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L187-L200
128,632
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.depth
public int depth(Tree node) { Tree p = node.parent(this); if (this == node) { return 0; } if (p == null) { return -1; } int depth = 1; while (this != p) { p = p.parent(this); depth++; } return depth; ...
java
public int depth(Tree node) { Tree p = node.parent(this); if (this == node) { return 0; } if (p == null) { return -1; } int depth = 1; while (this != p) { p = p.parent(this); depth++; } return depth; ...
[ "public", "int", "depth", "(", "Tree", "node", ")", "{", "Tree", "p", "=", "node", ".", "parent", "(", "this", ")", ";", "if", "(", "this", "==", "node", ")", "{", "return", "0", ";", "}", "if", "(", "p", "==", "null", ")", "{", "return", "-"...
Returns the distance between this node and the specified subnode @param node the node to get the distance from @return the distance between the 2 nodes
[ "Returns", "the", "distance", "between", "this", "node", "and", "the", "specified", "subnode" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L208-L222
128,633
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.parent
public Tree parent(Tree root) { List<Tree> kids = root.children(); return traverse(root, kids, this); }
java
public Tree parent(Tree root) { List<Tree> kids = root.children(); return traverse(root, kids, this); }
[ "public", "Tree", "parent", "(", "Tree", "root", ")", "{", "List", "<", "Tree", ">", "kids", "=", "root", ".", "children", "(", ")", ";", "return", "traverse", "(", "root", ",", "kids", ",", "this", ")", ";", "}" ]
Returns the parent of the passed in tree via traversal @param root the root node @return the tree to traverse
[ "Returns", "the", "parent", "of", "the", "passed", "in", "tree", "via", "traversal" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L229-L232
128,634
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.traverse
private static Tree traverse(Tree parent, List<Tree> kids, Tree node) { for (Tree kid : kids) { if (kid == node) { return parent; } Tree ret = node.parent(kid); if (ret != null) { return ret; } } return ...
java
private static Tree traverse(Tree parent, List<Tree> kids, Tree node) { for (Tree kid : kids) { if (kid == node) { return parent; } Tree ret = node.parent(kid); if (ret != null) { return ret; } } return ...
[ "private", "static", "Tree", "traverse", "(", "Tree", "parent", ",", "List", "<", "Tree", ">", "kids", ",", "Tree", "node", ")", "{", "for", "(", "Tree", "kid", ":", "kids", ")", "{", "if", "(", "kid", "==", "node", ")", "{", "return", "parent", ...
traverses the tree by recursion
[ "traverses", "the", "tree", "by", "recursion" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L236-L248
128,635
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.ancestor
public Tree ancestor(int height, Tree root) { if (height < 0) { throw new IllegalArgumentException("ancestor: height cannot be negative"); } if (height == 0) { return this; } Tree par = parent(root); if (par == null) { return null; ...
java
public Tree ancestor(int height, Tree root) { if (height < 0) { throw new IllegalArgumentException("ancestor: height cannot be negative"); } if (height == 0) { return this; } Tree par = parent(root); if (par == null) { return null; ...
[ "public", "Tree", "ancestor", "(", "int", "height", ",", "Tree", "root", ")", "{", "if", "(", "height", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"ancestor: height cannot be negative\"", ")", ";", "}", "if", "(", "height", "==", ...
Returns the ancestor of the given tree @param height @param root @return {@link Tree}
[ "Returns", "the", "ancestor", "of", "the", "given", "tree" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L256-L268
128,636
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.errorSum
public double errorSum() { if (isLeaf()) { return 0.0; } else if (isPreTerminal()) { return error(); } else { double error = 0.0; for (Tree child : children()) { error += child.errorSum(); } return error() + ...
java
public double errorSum() { if (isLeaf()) { return 0.0; } else if (isPreTerminal()) { return error(); } else { double error = 0.0; for (Tree child : children()) { error += child.errorSum(); } return error() + ...
[ "public", "double", "errorSum", "(", ")", "{", "if", "(", "isLeaf", "(", ")", ")", "{", "return", "0.0", ";", "}", "else", "if", "(", "isPreTerminal", "(", ")", ")", "{", "return", "error", "(", ")", ";", "}", "else", "{", "double", "error", "=",...
Returns the total prediction error for this tree and its children @return the total error for this tree and its children
[ "Returns", "the", "total", "prediction", "error", "for", "this", "tree", "and", "its", "children" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L276-L288
128,637
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.getLeaves
@SuppressWarnings("unchecked") public <T extends Tree> List<T> getLeaves(List<T> list) { if (isLeaf()) { list.add((T) this); } else { for (Tree kid : children()) { kid.getLeaves(list); } } return list; }
java
@SuppressWarnings("unchecked") public <T extends Tree> List<T> getLeaves(List<T> list) { if (isLeaf()) { list.add((T) this); } else { for (Tree kid : children()) { kid.getLeaves(list); } } return list; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", "extends", "Tree", ">", "List", "<", "T", ">", "getLeaves", "(", "List", "<", "T", ">", "list", ")", "{", "if", "(", "isLeaf", "(", ")", ")", "{", "list", ".", "add", "(", "(...
Gets the leaves of the tree. @param list The list in which the leaves of the tree will be placed. Normally, this will be empty when the routine is called, but if not, the new yield is added to the end of the list. @return a <code>List</code> of the leaves.
[ "Gets", "the", "leaves", "of", "the", "tree", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L310-L320
128,638
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java
Tree.connect
public void connect(List<Tree> children) { this.children = children; for (Tree t : children) t.setParent(this); }
java
public void connect(List<Tree> children) { this.children = children; for (Tree t : children) t.setParent(this); }
[ "public", "void", "connect", "(", "List", "<", "Tree", ">", "children", ")", "{", "this", ".", "children", "=", "children", ";", "for", "(", "Tree", "t", ":", "children", ")", "t", ".", "setParent", "(", "this", ")", ";", "}" ]
Connects the given trees and sets the parents of the children @param children the children to connect with
[ "Connects", "the", "given", "trees", "and", "sets", "the", "parents", "of", "the", "children" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/feedforward/autoencoder/recursive/Tree.java#L403-L407
128,639
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/string/NDArrayStrings.java
NDArrayStrings.format
public String format(INDArray arr, boolean summarize) { if(arr.isEmpty()) return EMPTY_ARRAY_STR; this.scientificFormat = "0."; int addPrecision = this.precision; while (addPrecision > 0) { this.scientificFormat += "#"; addPrecision -= 1; } ...
java
public String format(INDArray arr, boolean summarize) { if(arr.isEmpty()) return EMPTY_ARRAY_STR; this.scientificFormat = "0."; int addPrecision = this.precision; while (addPrecision > 0) { this.scientificFormat += "#"; addPrecision -= 1; } ...
[ "public", "String", "format", "(", "INDArray", "arr", ",", "boolean", "summarize", ")", "{", "if", "(", "arr", ".", "isEmpty", "(", ")", ")", "return", "EMPTY_ARRAY_STR", ";", "this", ".", "scientificFormat", "=", "\"0.\"", ";", "int", "addPrecision", "=",...
Format the given ndarray as a string @param arr the array to format @param summarize If true and the number of elements in the array is greater than > 1000 only the first three and last elements in any dimension will print @return the formatted array
[ "Format", "the", "given", "ndarray", "as", "a", "string" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/string/NDArrayStrings.java#L137-L151
128,640
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasLossUtils.java
KerasLossUtils.mapLossFunction
public static LossFunctions.LossFunction mapLossFunction(String kerasLoss, KerasLayerConfiguration conf) throws UnsupportedKerasConfigurationException { LossFunctions.LossFunction dl4jLoss; if (kerasLoss.equals(conf.getKERAS_LOSS_MEAN_SQUARED_ERROR()) || kerasLoss.equals(conf...
java
public static LossFunctions.LossFunction mapLossFunction(String kerasLoss, KerasLayerConfiguration conf) throws UnsupportedKerasConfigurationException { LossFunctions.LossFunction dl4jLoss; if (kerasLoss.equals(conf.getKERAS_LOSS_MEAN_SQUARED_ERROR()) || kerasLoss.equals(conf...
[ "public", "static", "LossFunctions", ".", "LossFunction", "mapLossFunction", "(", "String", "kerasLoss", ",", "KerasLayerConfiguration", "conf", ")", "throws", "UnsupportedKerasConfigurationException", "{", "LossFunctions", ".", "LossFunction", "dl4jLoss", ";", "if", "(",...
Map Keras to DL4J loss functions. @param kerasLoss String containing Keras loss function name @return String containing DL4J loss function
[ "Map", "Keras", "to", "DL4J", "loss", "functions", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasLossUtils.java#L37-L73
128,641
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/SequenceVectors.java
SequenceVectors.buildVocab
public void buildVocab() { val constructor = new VocabConstructor.Builder<T>().addSource(iterator, minWordFrequency) .setTargetVocabCache(vocab).fetchLabels(trainSequenceVectors).setStopWords(stopWords) .enableScavenger(enableScavenger).setEntriesLimit(vocabLimi...
java
public void buildVocab() { val constructor = new VocabConstructor.Builder<T>().addSource(iterator, minWordFrequency) .setTargetVocabCache(vocab).fetchLabels(trainSequenceVectors).setStopWords(stopWords) .enableScavenger(enableScavenger).setEntriesLimit(vocabLimi...
[ "public", "void", "buildVocab", "(", ")", "{", "val", "constructor", "=", "new", "VocabConstructor", ".", "Builder", "<", "T", ">", "(", ")", ".", "addSource", "(", "iterator", ",", "minWordFrequency", ")", ".", "setTargetVocabCache", "(", "vocab", ")", "....
Builds vocabulary from provided SequenceIterator instance
[ "Builds", "vocabulary", "from", "provided", "SequenceIterator", "instance" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/SequenceVectors.java#L135-L188
128,642
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/inverse/InvertMatrix.java
InvertMatrix.invert
public static INDArray invert(INDArray arr, boolean inPlace) { if(arr.rank() == 2 && arr.length() == 1){ //[1,1] edge case. Matrix inversion: [x] * [1/x] = [1] if(inPlace){ return arr.rdivi(1.0); } else { return arr.rdiv(1.0); } ...
java
public static INDArray invert(INDArray arr, boolean inPlace) { if(arr.rank() == 2 && arr.length() == 1){ //[1,1] edge case. Matrix inversion: [x] * [1/x] = [1] if(inPlace){ return arr.rdivi(1.0); } else { return arr.rdiv(1.0); } ...
[ "public", "static", "INDArray", "invert", "(", "INDArray", "arr", ",", "boolean", "inPlace", ")", "{", "if", "(", "arr", ".", "rank", "(", ")", "==", "2", "&&", "arr", ".", "length", "(", ")", "==", "1", ")", "{", "//[1,1] edge case. Matrix inversion: [x...
Inverts a matrix @param arr the array to invert @param inPlace Whether to store the result in {@code arr} @return the inverted matrix
[ "Inverts", "a", "matrix" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/inverse/InvertMatrix.java#L39-L69
128,643
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/inverse/InvertMatrix.java
InvertMatrix.pinvert
public static INDArray pinvert(INDArray arr, boolean inPlace) { // TODO : do it natively instead of relying on commons-maths RealMatrix realMatrix = CheckUtil.convertToApacheMatrix(arr); QRDecomposition decomposition = new QRDecomposition(realMatrix, 0); DecompositionSolver solver = de...
java
public static INDArray pinvert(INDArray arr, boolean inPlace) { // TODO : do it natively instead of relying on commons-maths RealMatrix realMatrix = CheckUtil.convertToApacheMatrix(arr); QRDecomposition decomposition = new QRDecomposition(realMatrix, 0); DecompositionSolver solver = de...
[ "public", "static", "INDArray", "pinvert", "(", "INDArray", "arr", ",", "boolean", "inPlace", ")", "{", "// TODO : do it natively instead of relying on commons-maths", "RealMatrix", "realMatrix", "=", "CheckUtil", ".", "convertToApacheMatrix", "(", "arr", ")", ";", "QRD...
Calculates pseudo inverse of a matrix using QR decomposition @param arr the array to invert @return the pseudo inverted matrix
[ "Calculates", "pseudo", "inverse", "of", "a", "matrix", "using", "QR", "decomposition" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/inverse/InvertMatrix.java#L76-L96
128,644
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/inverse/InvertMatrix.java
InvertMatrix.pLeftInvert
public static INDArray pLeftInvert(INDArray arr, boolean inPlace) { try { final INDArray inv = invert(arr.transpose().mmul(arr), inPlace).mmul(arr.transpose()); if (inPlace) arr.assign(inv); return inv; } catch (SingularMatrixException e) { throw new IllegalArgume...
java
public static INDArray pLeftInvert(INDArray arr, boolean inPlace) { try { final INDArray inv = invert(arr.transpose().mmul(arr), inPlace).mmul(arr.transpose()); if (inPlace) arr.assign(inv); return inv; } catch (SingularMatrixException e) { throw new IllegalArgume...
[ "public", "static", "INDArray", "pLeftInvert", "(", "INDArray", "arr", ",", "boolean", "inPlace", ")", "{", "try", "{", "final", "INDArray", "inv", "=", "invert", "(", "arr", ".", "transpose", "(", ")", ".", "mmul", "(", "arr", ")", ",", "inPlace", ")"...
Compute the left pseudo inverse. Input matrix must have full column rank. See also: <a href="https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse#Definition">Moore–Penrose inverse</a> @param arr Input matrix @param inPlace Whether to store the result in {@code arr} @return Left pseudo inverse of {@code arr} @e...
[ "Compute", "the", "left", "pseudo", "inverse", ".", "Input", "matrix", "must", "have", "full", "column", "rank", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/inverse/InvertMatrix.java#L108-L117
128,645
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/dropout/Dropout.java
Dropout.initializeHelper
protected void initializeHelper(DataType dataType){ String backend = Nd4j.getExecutioner().getEnvironmentInformation().getProperty("backend"); if("CUDA".equalsIgnoreCase(backend)) { try { helper = Class.forName("org.deeplearning4j.nn.layers.dropout.CudnnDropoutHelper") ...
java
protected void initializeHelper(DataType dataType){ String backend = Nd4j.getExecutioner().getEnvironmentInformation().getProperty("backend"); if("CUDA".equalsIgnoreCase(backend)) { try { helper = Class.forName("org.deeplearning4j.nn.layers.dropout.CudnnDropoutHelper") ...
[ "protected", "void", "initializeHelper", "(", "DataType", "dataType", ")", "{", "String", "backend", "=", "Nd4j", ".", "getExecutioner", "(", ")", ".", "getEnvironmentInformation", "(", ")", ".", "getProperty", "(", "\"backend\"", ")", ";", "if", "(", "\"CUDA\...
Initialize the CuDNN dropout helper, if possible
[ "Initialize", "the", "CuDNN", "dropout", "helper", "if", "possible" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/dropout/Dropout.java#L107-L126
128,646
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/graph/huffman/GraphHuffman.java
GraphHuffman.buildTree
public void buildTree(int[] vertexDegree) { PriorityQueue<Node> pq = new PriorityQueue<>(); for (int i = 0; i < vertexDegree.length; i++) pq.add(new Node(i, vertexDegree[i], null, null)); while (pq.size() > 1) { Node left = pq.remove(); Node right = pq.remove...
java
public void buildTree(int[] vertexDegree) { PriorityQueue<Node> pq = new PriorityQueue<>(); for (int i = 0; i < vertexDegree.length; i++) pq.add(new Node(i, vertexDegree[i], null, null)); while (pq.size() > 1) { Node left = pq.remove(); Node right = pq.remove...
[ "public", "void", "buildTree", "(", "int", "[", "]", "vertexDegree", ")", "{", "PriorityQueue", "<", "Node", ">", "pq", "=", "new", "PriorityQueue", "<>", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "vertexDegree", ".", "length", ...
Build the Huffman tree given an array of vertex degrees @param vertexDegree vertexDegree[i] = degree of ith vertex
[ "Build", "the", "Huffman", "tree", "given", "an", "array", "of", "vertex", "degrees" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/graph/huffman/GraphHuffman.java#L58-L76
128,647
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/AdaDeltaUpdater.java
AdaDeltaUpdater.applyUpdater
@Override public void applyUpdater(INDArray gradient, int iteration, int epoch) { if (msg == null || msdx == null) throw new IllegalStateException("Updater has not been initialized with view state"); double rho = config.getRho(); double epsilon = config.getEpsilon(); //...
java
@Override public void applyUpdater(INDArray gradient, int iteration, int epoch) { if (msg == null || msdx == null) throw new IllegalStateException("Updater has not been initialized with view state"); double rho = config.getRho(); double epsilon = config.getEpsilon(); //...
[ "@", "Override", "public", "void", "applyUpdater", "(", "INDArray", "gradient", ",", "int", "iteration", ",", "int", "epoch", ")", "{", "if", "(", "msg", "==", "null", "||", "msdx", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"Update...
Get the updated gradient for the given gradient and also update the state of ada delta. @param gradient the gradient to get the updated gradient for @param iteration @return the update gradient
[ "Get", "the", "updated", "gradient", "for", "the", "given", "gradient", "and", "also", "update", "the", "state", "of", "ada", "delta", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/AdaDeltaUpdater.java#L75-L96
128,648
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java
Schema.sameTypes
public boolean sameTypes(Schema schema) { if (schema.numColumns() != numColumns()) return false; for (int i = 0; i < schema.numColumns(); i++) { if (getType(i) != schema.getType(i)) return false; } return true; }
java
public boolean sameTypes(Schema schema) { if (schema.numColumns() != numColumns()) return false; for (int i = 0; i < schema.numColumns(); i++) { if (getType(i) != schema.getType(i)) return false; } return true; }
[ "public", "boolean", "sameTypes", "(", "Schema", "schema", ")", "{", "if", "(", "schema", ".", "numColumns", "(", ")", "!=", "numColumns", "(", ")", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "schema", ".", "numCo...
Returns true if the given schema has the same types at each index @param schema the schema to compare the types to @return true if the schema has the same types at every index as this one,false otherwise
[ "Returns", "true", "if", "the", "given", "schema", "has", "the", "same", "types", "at", "each", "index" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java#L103-L112
128,649
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java
Schema.getIndexOfColumn
public int getIndexOfColumn(String columnName) { Integer idx = columnNamesIndex.get(columnName); if (idx == null) throw new NoSuchElementException("Unknown column: \"" + columnName + "\""); return idx; }
java
public int getIndexOfColumn(String columnName) { Integer idx = columnNamesIndex.get(columnName); if (idx == null) throw new NoSuchElementException("Unknown column: \"" + columnName + "\""); return idx; }
[ "public", "int", "getIndexOfColumn", "(", "String", "columnName", ")", "{", "Integer", "idx", "=", "columnNamesIndex", ".", "get", "(", "columnName", ")", ";", "if", "(", "idx", "==", "null", ")", "throw", "new", "NoSuchElementException", "(", "\"Unknown colum...
Returns the index for the given column name @param columnName the column name to get the index for @return the index of the given column name for the schema
[ "Returns", "the", "index", "for", "the", "given", "column", "name" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java#L250-L255
128,650
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java
Schema.hasColumn
public boolean hasColumn(String columnName) { Integer idx = columnNamesIndex.get(columnName); return idx != null; }
java
public boolean hasColumn(String columnName) { Integer idx = columnNamesIndex.get(columnName); return idx != null; }
[ "public", "boolean", "hasColumn", "(", "String", "columnName", ")", "{", "Integer", "idx", "=", "columnNamesIndex", ".", "get", "(", "columnName", ")", ";", "return", "idx", "!=", "null", ";", "}" ]
Determine if the schema has a column with the specified name @param columnName Name to see if the column exists @return True if a column exists for that name, false otherwise
[ "Determine", "if", "the", "schema", "has", "a", "column", "with", "the", "specified", "name" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java#L287-L290
128,651
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java
Schema.fromJson
public static Schema fromJson(String json) { try{ return JsonMappers.getMapper().readValue(json, Schema.class); } catch (Exception e){ //TODO better exceptions throw new RuntimeException(e); } }
java
public static Schema fromJson(String json) { try{ return JsonMappers.getMapper().readValue(json, Schema.class); } catch (Exception e){ //TODO better exceptions throw new RuntimeException(e); } }
[ "public", "static", "Schema", "fromJson", "(", "String", "json", ")", "{", "try", "{", "return", "JsonMappers", ".", "getMapper", "(", ")", ".", "readValue", "(", "json", ",", "Schema", ".", "class", ")", ";", "}", "catch", "(", "Exception", "e", ")", ...
Create a schema from a given json string @param json the json to create the schema from @return the created schema based on the json
[ "Create", "a", "schema", "from", "a", "given", "json", "string" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java#L358-L365
128,652
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java
Schema.fromYaml
public static Schema fromYaml(String yaml) { try{ return JsonMappers.getMapperYaml().readValue(yaml, Schema.class); } catch (Exception e){ //TODO better exceptions throw new RuntimeException(e); } }
java
public static Schema fromYaml(String yaml) { try{ return JsonMappers.getMapperYaml().readValue(yaml, Schema.class); } catch (Exception e){ //TODO better exceptions throw new RuntimeException(e); } }
[ "public", "static", "Schema", "fromYaml", "(", "String", "yaml", ")", "{", "try", "{", "return", "JsonMappers", ".", "getMapperYaml", "(", ")", ".", "readValue", "(", "yaml", ",", "Schema", ".", "class", ")", ";", "}", "catch", "(", "Exception", "e", "...
Create a schema from the given yaml string @param yaml the yaml to create the schema from @return the created schema based on the yaml
[ "Create", "a", "schema", "from", "the", "given", "yaml", "string" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java#L373-L380
128,653
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java
Schema.infer
public static Schema infer(List<Writable> record) { Schema.Builder builder = new Schema.Builder(); for (int i = 0; i < record.size(); i++) { if (record.get(i) instanceof DoubleWritable) builder.addColumnDouble(String.valueOf(i)); else if (record.get(i) instanceof ...
java
public static Schema infer(List<Writable> record) { Schema.Builder builder = new Schema.Builder(); for (int i = 0; i < record.size(); i++) { if (record.get(i) instanceof DoubleWritable) builder.addColumnDouble(String.valueOf(i)); else if (record.get(i) instanceof ...
[ "public", "static", "Schema", "infer", "(", "List", "<", "Writable", ">", "record", ")", "{", "Schema", ".", "Builder", "builder", "=", "new", "Schema", ".", "Builder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "record", ".", ...
Infers a schema based on the record. The column names are based on indexing. @param record the record to infer from @return the infered schema
[ "Infers", "a", "schema", "based", "on", "the", "record", ".", "The", "column", "names", "are", "based", "on", "indexing", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/schema/Schema.java#L857-L878
128,654
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationCalibration.java
EvaluationCalibration.getReliabilityDiagram
public ReliabilityDiagram getReliabilityDiagram(int classIdx) { INDArray totalCountBins = rDiagBinTotalCount.getColumn(classIdx); INDArray countPositiveBins = rDiagBinPosCount.getColumn(classIdx); double[] meanPredictionBins = rDiagBinSumPredictions.getColumn(classIdx).castTo(DataType.DOUBLE) ...
java
public ReliabilityDiagram getReliabilityDiagram(int classIdx) { INDArray totalCountBins = rDiagBinTotalCount.getColumn(classIdx); INDArray countPositiveBins = rDiagBinPosCount.getColumn(classIdx); double[] meanPredictionBins = rDiagBinSumPredictions.getColumn(classIdx).castTo(DataType.DOUBLE) ...
[ "public", "ReliabilityDiagram", "getReliabilityDiagram", "(", "int", "classIdx", ")", "{", "INDArray", "totalCountBins", "=", "rDiagBinTotalCount", ".", "getColumn", "(", "classIdx", ")", ";", "INDArray", "countPositiveBins", "=", "rDiagBinPosCount", ".", "getColumn", ...
Get the reliability diagram for the specified class @param classIdx Index of the class to get the reliability diagram for
[ "Get", "the", "reliability", "diagram", "for", "the", "specified", "class" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationCalibration.java#L371-L403
128,655
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/NDArray.java
NDArray.unsafeDuplication
@Override public INDArray unsafeDuplication() { WorkspaceUtils.assertValidArray(this, "Cannot duplicate array"); if (isView()) return this.dup(this.ordering()); DataBuffer rb = Nd4j.getMemoryManager().getCurrentWorkspace() == null ? Nd4j.getDataBufferFactory().createSame(this.da...
java
@Override public INDArray unsafeDuplication() { WorkspaceUtils.assertValidArray(this, "Cannot duplicate array"); if (isView()) return this.dup(this.ordering()); DataBuffer rb = Nd4j.getMemoryManager().getCurrentWorkspace() == null ? Nd4j.getDataBufferFactory().createSame(this.da...
[ "@", "Override", "public", "INDArray", "unsafeDuplication", "(", ")", "{", "WorkspaceUtils", ".", "assertValidArray", "(", "this", ",", "\"Cannot duplicate array\"", ")", ";", "if", "(", "isView", "(", ")", ")", "return", "this", ".", "dup", "(", "this", "."...
This method does direct array copy. Impossible to use on views or mixed orders. PLEASE NOTE: YOU SHOULD NEVER USE THIS METHOD, UNLESS YOU 100% CLEAR ABOUT IT @return
[ "This", "method", "does", "direct", "array", "copy", ".", "Impossible", "to", "use", "on", "views", "or", "mixed", "orders", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/NDArray.java#L469-L486
128,656
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/api/loader/FileBatch.java
FileBatch.forFiles
public static FileBatch forFiles(List<File> files) throws IOException { List<String> origPaths = new ArrayList<>(files.size()); List<byte[]> bytes = new ArrayList<>(files.size()); for (File f : files) { bytes.add(FileUtils.readFileToByteArray(f)); origPaths.add(f.toURI()....
java
public static FileBatch forFiles(List<File> files) throws IOException { List<String> origPaths = new ArrayList<>(files.size()); List<byte[]> bytes = new ArrayList<>(files.size()); for (File f : files) { bytes.add(FileUtils.readFileToByteArray(f)); origPaths.add(f.toURI()....
[ "public", "static", "FileBatch", "forFiles", "(", "List", "<", "File", ">", "files", ")", "throws", "IOException", "{", "List", "<", "String", ">", "origPaths", "=", "new", "ArrayList", "<>", "(", "files", ".", "size", "(", ")", ")", ";", "List", "<", ...
Create a FileBatch from the specified files @param files Files to create the FileBatch from @return The created FileBatch @throws IOException If an error occurs during reading of the file content
[ "Create", "a", "FileBatch", "from", "the", "specified", "files" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/api/loader/FileBatch.java#L105-L113
128,657
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-data/deeplearning4j-utility-iterators/src/main/java/org/deeplearning4j/datasets/iterator/parallel/MultiBoolean.java
MultiBoolean.set
public void set(boolean value, int entry) { if (entry > numEntries || entry < 0) throw new ND4JIllegalStateException( "Entry index given (" + entry + ")in is higher then configured one (" + numEntries + ")"); if (oneTime && this.timeTracker.get(entry)) ...
java
public void set(boolean value, int entry) { if (entry > numEntries || entry < 0) throw new ND4JIllegalStateException( "Entry index given (" + entry + ")in is higher then configured one (" + numEntries + ")"); if (oneTime && this.timeTracker.get(entry)) ...
[ "public", "void", "set", "(", "boolean", "value", ",", "int", "entry", ")", "{", "if", "(", "entry", ">", "numEntries", "||", "entry", "<", "0", ")", "throw", "new", "ND4JIllegalStateException", "(", "\"Entry index given (\"", "+", "entry", "+", "\")in is hi...
Sets specified entry to specified state @param value @param entry
[ "Sets", "specified", "entry", "to", "specified", "state" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-data/deeplearning4j-utility-iterators/src/main/java/org/deeplearning4j/datasets/iterator/parallel/MultiBoolean.java#L69-L84
128,658
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-data/deeplearning4j-utility-iterators/src/main/java/org/deeplearning4j/datasets/iterator/parallel/MultiBoolean.java
MultiBoolean.get
public boolean get(int entry) { if (entry > numEntries || entry < 0) throw new ND4JIllegalStateException( "Entry index given (" + entry + ")in is higher then configured one (" + numEntries + ")"); return (this.holder & 1 << (entry + 1)) != 0; }
java
public boolean get(int entry) { if (entry > numEntries || entry < 0) throw new ND4JIllegalStateException( "Entry index given (" + entry + ")in is higher then configured one (" + numEntries + ")"); return (this.holder & 1 << (entry + 1)) != 0; }
[ "public", "boolean", "get", "(", "int", "entry", ")", "{", "if", "(", "entry", ">", "numEntries", "||", "entry", "<", "0", ")", "throw", "new", "ND4JIllegalStateException", "(", "\"Entry index given (\"", "+", "entry", "+", "\")in is higher then configured one (\"...
Gets current state for specified entry @param entry @return
[ "Gets", "current", "state", "for", "specified", "entry" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-data/deeplearning4j-utility-iterators/src/main/java/org/deeplearning4j/datasets/iterator/parallel/MultiBoolean.java#L92-L98
128,659
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/condition/BooleanCondition.java
BooleanCondition.XOR
public static Condition XOR(Condition first, Condition second) { return new BooleanCondition(Type.XOR, first, second); }
java
public static Condition XOR(Condition first, Condition second) { return new BooleanCondition(Type.XOR, first, second); }
[ "public", "static", "Condition", "XOR", "(", "Condition", "first", ",", "Condition", "second", ")", "{", "return", "new", "BooleanCondition", "(", "Type", ".", "XOR", ",", "first", ",", "second", ")", ";", "}" ]
And of all the given conditions @param first the first condition @param second the second condition for xor @return the xor of these 2 conditions
[ "And", "of", "all", "the", "given", "conditions" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/condition/BooleanCondition.java#L296-L298
128,660
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/graph/walkers/impl/RandomWalker.java
RandomWalker.reset
@Override public void reset(boolean shuffle) { this.position.set(0); if (shuffle) { logger.debug("Calling shuffle() on entries..."); // https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm for (int i = order.length - 1; i > 0; i--) { ...
java
@Override public void reset(boolean shuffle) { this.position.set(0); if (shuffle) { logger.debug("Calling shuffle() on entries..."); // https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm for (int i = order.length - 1; i > 0; i--) { ...
[ "@", "Override", "public", "void", "reset", "(", "boolean", "shuffle", ")", "{", "this", ".", "position", ".", "set", "(", "0", ")", ";", "if", "(", "shuffle", ")", "{", "logger", ".", "debug", "(", "\"Calling shuffle() on entries...\"", ")", ";", "// ht...
This method resets walker @param shuffle if TRUE, order of walks will be shuffled
[ "This", "method", "resets", "walker" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/graph/walkers/impl/RandomWalker.java#L248-L261
128,661
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java
SDValidation.validateInteger
protected static void validateInteger(String opName, SDVariable v) { if (v == null) return; if (!v.dataType().isIntType()) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with non-integer data type " + v.dataType()...
java
protected static void validateInteger(String opName, SDVariable v) { if (v == null) return; if (!v.dataType().isIntType()) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with non-integer data type " + v.dataType()...
[ "protected", "static", "void", "validateInteger", "(", "String", "opName", ",", "SDVariable", "v", ")", "{", "if", "(", "v", "==", "null", ")", "return", ";", "if", "(", "!", "v", ".", "dataType", "(", ")", ".", "isIntType", "(", ")", ")", "throw", ...
Validate that the operation is being applied on an integer type SDVariable @param opName Operation name to print in the exception @param v Variable to validate datatype for (input to operation)
[ "Validate", "that", "the", "operation", "is", "being", "applied", "on", "an", "integer", "type", "SDVariable" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java#L62-L67
128,662
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java
SDValidation.validateFloatingPoint
protected static void validateFloatingPoint(String opName, SDVariable v) { if (v == null) return; if (!v.dataType().isFPType()) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with non-floating point data type " + ...
java
protected static void validateFloatingPoint(String opName, SDVariable v) { if (v == null) return; if (!v.dataType().isFPType()) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with non-floating point data type " + ...
[ "protected", "static", "void", "validateFloatingPoint", "(", "String", "opName", ",", "SDVariable", "v", ")", "{", "if", "(", "v", "==", "null", ")", "return", ";", "if", "(", "!", "v", ".", "dataType", "(", ")", ".", "isFPType", "(", ")", ")", "thro...
Validate that the operation is being applied on an floating point type SDVariable @param opName Operation name to print in the exception @param v Variable to validate datatype for (input to operation)
[ "Validate", "that", "the", "operation", "is", "being", "applied", "on", "an", "floating", "point", "type", "SDVariable" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java#L90-L95
128,663
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java
SDValidation.validateBool
protected static void validateBool(String opName, SDVariable v) { if (v == null) return; if (v.dataType() != DataType.BOOL) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with non-boolean point data type " + v.dat...
java
protected static void validateBool(String opName, SDVariable v) { if (v == null) return; if (v.dataType() != DataType.BOOL) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with non-boolean point data type " + v.dat...
[ "protected", "static", "void", "validateBool", "(", "String", "opName", ",", "SDVariable", "v", ")", "{", "if", "(", "v", "==", "null", ")", "return", ";", "if", "(", "v", ".", "dataType", "(", ")", "!=", "DataType", ".", "BOOL", ")", "throw", "new",...
Validate that the operation is being applied on a boolean type SDVariable @param opName Operation name to print in the exception @param v Variable to validate datatype for (input to operation)
[ "Validate", "that", "the", "operation", "is", "being", "applied", "on", "a", "boolean", "type", "SDVariable" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java#L118-L123
128,664
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java
SDValidation.validateBool
protected static void validateBool(String opName, SDVariable v1, SDVariable v2) { if (v1.dataType() != DataType.BOOL || v2.dataType() != DataType.BOOL) throw new IllegalStateException("Cannot perform operation \"" + opName + "\" on variables \"" + v1.getVarName() + "\" and \"" + ...
java
protected static void validateBool(String opName, SDVariable v1, SDVariable v2) { if (v1.dataType() != DataType.BOOL || v2.dataType() != DataType.BOOL) throw new IllegalStateException("Cannot perform operation \"" + opName + "\" on variables \"" + v1.getVarName() + "\" and \"" + ...
[ "protected", "static", "void", "validateBool", "(", "String", "opName", ",", "SDVariable", "v1", ",", "SDVariable", "v2", ")", "{", "if", "(", "v1", ".", "dataType", "(", ")", "!=", "DataType", ".", "BOOL", "||", "v2", ".", "dataType", "(", ")", "!=", ...
Validate that the operation is being applied on boolean SDVariables @param opName Operation name to print in the exception @param v1 Variable to validate datatype for (input to operation) @param v2 Variable to validate datatype for (input to operation)
[ "Validate", "that", "the", "operation", "is", "being", "applied", "on", "boolean", "SDVariables" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java#L147-L151
128,665
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-data/deeplearning4j-utility-iterators/src/main/java/org/deeplearning4j/datasets/iterator/JointMultiDataSetIterator.java
JointMultiDataSetIterator.resetSupported
@Override public boolean resetSupported() { boolean sup = true; for (val i: iterators) if (!i.resetSupported()) { sup = false; break; } return sup; }
java
@Override public boolean resetSupported() { boolean sup = true; for (val i: iterators) if (!i.resetSupported()) { sup = false; break; } return sup; }
[ "@", "Override", "public", "boolean", "resetSupported", "(", ")", "{", "boolean", "sup", "=", "true", ";", "for", "(", "val", "i", ":", "iterators", ")", "if", "(", "!", "i", ".", "resetSupported", "(", ")", ")", "{", "sup", "=", "false", ";", "bre...
Is resetting supported by this DataSetIterator? Many DataSetIterators do support resetting, but some don't @return true if reset method is supported; false otherwise
[ "Is", "resetting", "supported", "by", "this", "DataSetIterator?", "Many", "DataSetIterators", "do", "support", "resetting", "but", "some", "don", "t" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-data/deeplearning4j-utility-iterators/src/main/java/org/deeplearning4j/datasets/iterator/JointMultiDataSetIterator.java#L107-L118
128,666
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java
DoubleArrayTrie.read
public static DoubleArrayTrie read(InputStream input) throws IOException { DoubleArrayTrie trie = new DoubleArrayTrie(); DataInputStream dis = new DataInputStream(new BufferedInputStream(input)); trie.compact = dis.readBoolean(); int baseCheckSize = dis.readInt(); // Read size of baseAr...
java
public static DoubleArrayTrie read(InputStream input) throws IOException { DoubleArrayTrie trie = new DoubleArrayTrie(); DataInputStream dis = new DataInputStream(new BufferedInputStream(input)); trie.compact = dis.readBoolean(); int baseCheckSize = dis.readInt(); // Read size of baseAr...
[ "public", "static", "DoubleArrayTrie", "read", "(", "InputStream", "input", ")", "throws", "IOException", "{", "DoubleArrayTrie", "trie", "=", "new", "DoubleArrayTrie", "(", ")", ";", "DataInputStream", "dis", "=", "new", "DataInputStream", "(", "new", "BufferedIn...
Load Stored data @param input input stream to read the double array trie from @return double array trie, not null @throws IOException if an IO error occured during reading the double array trie
[ "Load", "Stored", "data" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java#L111-L137
128,667
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java
DoubleArrayTrie.build
public void build(Trie trie) { ProgressLog.begin("building " + (compact ? "compact" : "sparse") + " trie"); baseBuffer = IntBuffer.allocate(BASE_CHECK_INITIAL_SIZE); baseBuffer.put(0, 1); checkBuffer = IntBuffer.allocate(BASE_CHECK_INITIAL_SIZE); tailBuffer = CharBuffer.allocate(...
java
public void build(Trie trie) { ProgressLog.begin("building " + (compact ? "compact" : "sparse") + " trie"); baseBuffer = IntBuffer.allocate(BASE_CHECK_INITIAL_SIZE); baseBuffer.put(0, 1); checkBuffer = IntBuffer.allocate(BASE_CHECK_INITIAL_SIZE); tailBuffer = CharBuffer.allocate(...
[ "public", "void", "build", "(", "Trie", "trie", ")", "{", "ProgressLog", ".", "begin", "(", "\"building \"", "+", "(", "compact", "?", "\"compact\"", ":", "\"sparse\"", ")", "+", "\" trie\"", ")", ";", "baseBuffer", "=", "IntBuffer", ".", "allocate", "(", ...
Construct double array trie which is equivalent to input trie @param trie normal trie, which contains all dictionary words
[ "Construct", "double", "array", "trie", "which", "is", "equivalent", "to", "input", "trie" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java#L144-L153
128,668
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java
DoubleArrayTrie.matchTail
private int matchTail(int base, int index, String key) { int positionInTailArr = base - TAIL_OFFSET; int keyLength = key.length(); for (int i = 0; i < keyLength; i++) { if (key.charAt(i) != tailBuffer.get(positionInTailArr + i)) { return -1; } } ...
java
private int matchTail(int base, int index, String key) { int positionInTailArr = base - TAIL_OFFSET; int keyLength = key.length(); for (int i = 0; i < keyLength; i++) { if (key.charAt(i) != tailBuffer.get(positionInTailArr + i)) { return -1; } } ...
[ "private", "int", "matchTail", "(", "int", "base", ",", "int", "index", ",", "String", "key", ")", "{", "int", "positionInTailArr", "=", "base", "-", "TAIL_OFFSET", ";", "int", "keyLength", "=", "key", ".", "length", "(", ")", ";", "for", "(", "int", ...
Check match in tail array @param base @param index @param key @return index if it is complete match. 0 if it is prefix match. negative value if it doesn't match
[ "Check", "match", "in", "tail", "array" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java#L264-L274
128,669
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java
DoubleArrayTrie.findBase
private int findBase(int index, List<Trie.Node> nodes) { int base = baseBuffer.get(index); if (base < 0) { return base; } while (true) { boolean collision = false; // already taken? for (Trie.Node node : nodes) { int nextIndex = index ...
java
private int findBase(int index, List<Trie.Node> nodes) { int base = baseBuffer.get(index); if (base < 0) { return base; } while (true) { boolean collision = false; // already taken? for (Trie.Node node : nodes) { int nextIndex = index ...
[ "private", "int", "findBase", "(", "int", "index", ",", "List", "<", "Trie", ".", "Node", ">", "nodes", ")", "{", "int", "base", "=", "baseBuffer", ".", "get", "(", "index", ")", ";", "if", "(", "base", "<", "0", ")", "{", "return", "base", ";", ...
Find base value for current node, which contains input nodes. They are children of current node. Set default base value , which is one, at the index of each input node. @param index @param nodes @return base value for current node
[ "Find", "base", "value", "for", "current", "node", "which", "contains", "input", "nodes", ".", "They", "are", "children", "of", "current", "node", ".", "Set", "default", "base", "value", "which", "is", "one", "at", "the", "index", "of", "each", "input", ...
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/trie/DoubleArrayTrie.java#L284-L318
128,670
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/checkutil/CheckUtil.java
CheckUtil.checkAdd
public static boolean checkAdd(INDArray first, INDArray second, double maxRelativeDifference, double minAbsDifference) { RealMatrix rmFirst = convertToApacheMatrix(first); RealMatrix rmSecond = convertToApacheMatrix(second); INDArray result = first.add(second); RealM...
java
public static boolean checkAdd(INDArray first, INDArray second, double maxRelativeDifference, double minAbsDifference) { RealMatrix rmFirst = convertToApacheMatrix(first); RealMatrix rmSecond = convertToApacheMatrix(second); INDArray result = first.add(second); RealM...
[ "public", "static", "boolean", "checkAdd", "(", "INDArray", "first", ",", "INDArray", "second", ",", "double", "maxRelativeDifference", ",", "double", "minAbsDifference", ")", "{", "RealMatrix", "rmFirst", "=", "convertToApacheMatrix", "(", "first", ")", ";", "Rea...
Same as checkMmul, but for matrix addition
[ "Same", "as", "checkMmul", "but", "for", "matrix", "addition" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/checkutil/CheckUtil.java#L112-L128
128,671
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/checkutil/CheckUtil.java
CheckUtil.checkSubtract
public static boolean checkSubtract(INDArray first, INDArray second, double maxRelativeDifference, double minAbsDifference) { RealMatrix rmFirst = convertToApacheMatrix(first); RealMatrix rmSecond = convertToApacheMatrix(second); INDArray result = first.sub(second); ...
java
public static boolean checkSubtract(INDArray first, INDArray second, double maxRelativeDifference, double minAbsDifference) { RealMatrix rmFirst = convertToApacheMatrix(first); RealMatrix rmSecond = convertToApacheMatrix(second); INDArray result = first.sub(second); ...
[ "public", "static", "boolean", "checkSubtract", "(", "INDArray", "first", ",", "INDArray", "second", ",", "double", "maxRelativeDifference", ",", "double", "minAbsDifference", ")", "{", "RealMatrix", "rmFirst", "=", "convertToApacheMatrix", "(", "first", ")", ";", ...
Same as checkMmul, but for matrix subtraction
[ "Same", "as", "checkMmul", "but", "for", "matrix", "subtraction" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/checkutil/CheckUtil.java#L131-L147
128,672
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/workspace/WorkspaceUtils.java
WorkspaceUtils.assertNoWorkspacesOpen
public static void assertNoWorkspacesOpen(String msg, boolean allowScopedOut) throws ND4JWorkspaceException { if (Nd4j.getWorkspaceManager().anyWorkspaceActiveForCurrentThread()) { MemoryWorkspace currWs = Nd4j.getMemoryManager().getCurrentWorkspace(); if(allowScopedOut && (currWs == nu...
java
public static void assertNoWorkspacesOpen(String msg, boolean allowScopedOut) throws ND4JWorkspaceException { if (Nd4j.getWorkspaceManager().anyWorkspaceActiveForCurrentThread()) { MemoryWorkspace currWs = Nd4j.getMemoryManager().getCurrentWorkspace(); if(allowScopedOut && (currWs == nu...
[ "public", "static", "void", "assertNoWorkspacesOpen", "(", "String", "msg", ",", "boolean", "allowScopedOut", ")", "throws", "ND4JWorkspaceException", "{", "if", "(", "Nd4j", ".", "getWorkspaceManager", "(", ")", ".", "anyWorkspaceActiveForCurrentThread", "(", ")", ...
Assert that no workspaces are currently open @param msg Message to include in the exception, if required @param allowScopedOut If true: don't fail if we have an open workspace but are currently scoped out
[ "Assert", "that", "no", "workspaces", "are", "currently", "open" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/workspace/WorkspaceUtils.java#L56-L72
128,673
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/src/main/java/org/deeplearning4j/text/corpora/treeparser/HeadWordFinder.java
HeadWordFinder.findHead
public Tree findHead(Tree parentNode) { Tree cursor = parentNode.getType().equals("TOP") ? parentNode.firstChild() : parentNode; while (cursor.children() != null && !cursor.children().isEmpty()) cursor = findHead2(cursor); return cursor; }
java
public Tree findHead(Tree parentNode) { Tree cursor = parentNode.getType().equals("TOP") ? parentNode.firstChild() : parentNode; while (cursor.children() != null && !cursor.children().isEmpty()) cursor = findHead2(cursor); return cursor; }
[ "public", "Tree", "findHead", "(", "Tree", "parentNode", ")", "{", "Tree", "cursor", "=", "parentNode", ".", "getType", "(", ")", ".", "equals", "(", "\"TOP\"", ")", "?", "parentNode", ".", "firstChild", "(", ")", ":", "parentNode", ";", "while", "(", ...
Finds the bottom most head @param parentNode the bottom most head @return the bottom most head (no children) for the given parent
[ "Finds", "the", "bottom", "most", "head" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/src/main/java/org/deeplearning4j/text/corpora/treeparser/HeadWordFinder.java#L87-L94
128,674
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/util/UnknownDictionaryEntryParser.java
UnknownDictionaryEntryParser.parse
public GenericDictionaryEntry parse(String entry) { String[] fields = parseLine(entry); String surface = fields[0]; short leftId = Short.parseShort(fields[1]); short rightId = Short.parseShort(fields[2]); short wordCost = Short.parseShort(fields[3]); List<String> pos = ...
java
public GenericDictionaryEntry parse(String entry) { String[] fields = parseLine(entry); String surface = fields[0]; short leftId = Short.parseShort(fields[1]); short rightId = Short.parseShort(fields[2]); short wordCost = Short.parseShort(fields[3]); List<String> pos = ...
[ "public", "GenericDictionaryEntry", "parse", "(", "String", "entry", ")", "{", "String", "[", "]", "fields", "=", "parseLine", "(", "entry", ")", ";", "String", "surface", "=", "fields", "[", "0", "]", ";", "short", "leftId", "=", "Short", ".", "parseSho...
which is okay for all the dictionaries supported so far...
[ "which", "is", "okay", "for", "all", "the", "dictionaries", "supported", "so", "far", "..." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/util/UnknownDictionaryEntryParser.java#L29-L47
128,675
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.multiply
public Rational multiply(final BigInteger val) { Rational val2 = new Rational(val, BigInteger.ONE); return (multiply(val2)); }
java
public Rational multiply(final BigInteger val) { Rational val2 = new Rational(val, BigInteger.ONE); return (multiply(val2)); }
[ "public", "Rational", "multiply", "(", "final", "BigInteger", "val", ")", "{", "Rational", "val2", "=", "new", "Rational", "(", "val", ",", "BigInteger", ".", "ONE", ")", ";", "return", "(", "multiply", "(", "val2", ")", ")", ";", "}" ]
Multiply by a BigInteger. @param val a second number. @return the product of this with the value.
[ "Multiply", "by", "a", "BigInteger", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L198-L201
128,676
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.multiply
public Rational multiply(final int val) { BigInteger tmp = BigInteger.valueOf(val); return multiply(tmp); }
java
public Rational multiply(final int val) { BigInteger tmp = BigInteger.valueOf(val); return multiply(tmp); }
[ "public", "Rational", "multiply", "(", "final", "int", "val", ")", "{", "BigInteger", "tmp", "=", "BigInteger", ".", "valueOf", "(", "val", ")", ";", "return", "multiply", "(", "tmp", ")", ";", "}" ]
Multiply by an integer. @param val a second number. @return the product of this with the value.
[ "Multiply", "by", "an", "integer", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L209-L212
128,677
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.divide
public Rational divide(BigInteger val) { Rational val2 = new Rational(val, BigInteger.ONE); return (divide(val2)); }
java
public Rational divide(BigInteger val) { Rational val2 = new Rational(val, BigInteger.ONE); return (divide(val2)); }
[ "public", "Rational", "divide", "(", "BigInteger", "val", ")", "{", "Rational", "val2", "=", "new", "Rational", "(", "val", ",", "BigInteger", ".", "ONE", ")", ";", "return", "(", "divide", "(", "val2", ")", ")", ";", "}" ]
Divide by an integer. @param val a second number. @return the value of this/val
[ "Divide", "by", "an", "integer", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L274-L277
128,678
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.add
public Rational add(Rational val) { BigInteger num = a.multiply(val.b).add(b.multiply(val.a)); BigInteger deno = b.multiply(val.b); return (new Rational(num, deno)); }
java
public Rational add(Rational val) { BigInteger num = a.multiply(val.b).add(b.multiply(val.a)); BigInteger deno = b.multiply(val.b); return (new Rational(num, deno)); }
[ "public", "Rational", "add", "(", "Rational", "val", ")", "{", "BigInteger", "num", "=", "a", ".", "multiply", "(", "val", ".", "b", ")", ".", "add", "(", "b", ".", "multiply", "(", "val", ".", "a", ")", ")", ";", "BigInteger", "deno", "=", "b", ...
Add another fraction. @param val The number to be added @return this+val.
[ "Add", "another", "fraction", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L296-L300
128,679
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.add
public Rational add(BigInteger val) { Rational val2 = new Rational(val, BigInteger.ONE); return (add(val2)); }
java
public Rational add(BigInteger val) { Rational val2 = new Rational(val, BigInteger.ONE); return (add(val2)); }
[ "public", "Rational", "add", "(", "BigInteger", "val", ")", "{", "Rational", "val2", "=", "new", "Rational", "(", "val", ",", "BigInteger", ".", "ONE", ")", ";", "return", "(", "add", "(", "val2", ")", ")", ";", "}" ]
Add another integer. @param val The number to be added @return this+val.
[ "Add", "another", "integer", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L308-L311
128,680
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.subtract
public Rational subtract(Rational val) { Rational val2 = val.negate(); return (add(val2)); }
java
public Rational subtract(Rational val) { Rational val2 = val.negate(); return (add(val2)); }
[ "public", "Rational", "subtract", "(", "Rational", "val", ")", "{", "Rational", "val2", "=", "val", ".", "negate", "(", ")", ";", "return", "(", "add", "(", "val2", ")", ")", ";", "}" ]
Subtract another fraction. 7 @param val the number to be subtracted from this @return this - val.
[ "Subtract", "another", "fraction", ".", "7" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L329-L332
128,681
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.subtract
public Rational subtract(BigInteger val) { Rational val2 = new Rational(val, BigInteger.ONE); return (subtract(val2)); }
java
public Rational subtract(BigInteger val) { Rational val2 = new Rational(val, BigInteger.ONE); return (subtract(val2)); }
[ "public", "Rational", "subtract", "(", "BigInteger", "val", ")", "{", "Rational", "val2", "=", "new", "Rational", "(", "val", ",", "BigInteger", ".", "ONE", ")", ";", "return", "(", "subtract", "(", "val2", ")", ")", ";", "}" ]
Subtract an integer. @param val the number to be subtracted from this @return this - val.
[ "Subtract", "an", "integer", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L340-L343
128,682
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.trunc
public BigInteger trunc() { /* is already integer: return the numerator */ if (b.compareTo(BigInteger.ONE) == 0) { return a; } else { return a.divide(b); } }
java
public BigInteger trunc() { /* is already integer: return the numerator */ if (b.compareTo(BigInteger.ONE) == 0) { return a; } else { return a.divide(b); } }
[ "public", "BigInteger", "trunc", "(", ")", "{", "/* is already integer: return the numerator\n */", "if", "(", "b", ".", "compareTo", "(", "BigInteger", ".", "ONE", ")", "==", "0", ")", "{", "return", "a", ";", "}", "else", "{", "return", "a", ".", ...
Remove the fractional part. @return The integer rounded towards zero.
[ "Remove", "the", "fractional", "part", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L406-L414
128,683
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.doubleValue
public double doubleValue() { /* To meet the risk of individual overflows of the exponents of * a separate invocation a.doubleValue() or b.doubleValue(), we divide first * in a BigDecimal environment and converst the result. */ BigDecimal adivb = (new BigDecimal(a)).divide(new...
java
public double doubleValue() { /* To meet the risk of individual overflows of the exponents of * a separate invocation a.doubleValue() or b.doubleValue(), we divide first * in a BigDecimal environment and converst the result. */ BigDecimal adivb = (new BigDecimal(a)).divide(new...
[ "public", "double", "doubleValue", "(", ")", "{", "/* To meet the risk of individual overflows of the exponents of\n * a separate invocation a.doubleValue() or b.doubleValue(), we divide first\n * in a BigDecimal environment and converst the result.\n */", "BigDecimal", "adiv...
Return a double value representation. @return The value with double precision.
[ "Return", "a", "double", "value", "representation", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L468-L475
128,684
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.floatValue
public float floatValue() { BigDecimal adivb = (new BigDecimal(a)).divide(new BigDecimal(b), MathContext.DECIMAL128); return adivb.floatValue(); }
java
public float floatValue() { BigDecimal adivb = (new BigDecimal(a)).divide(new BigDecimal(b), MathContext.DECIMAL128); return adivb.floatValue(); }
[ "public", "float", "floatValue", "(", ")", "{", "BigDecimal", "adivb", "=", "(", "new", "BigDecimal", "(", "a", ")", ")", ".", "divide", "(", "new", "BigDecimal", "(", "b", ")", ",", "MathContext", ".", "DECIMAL128", ")", ";", "return", "adivb", ".", ...
Return a float value representation. @return The value with single precision.
[ "Return", "a", "float", "value", "representation", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L483-L486
128,685
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.BigDecimalValue
public BigDecimal BigDecimalValue(MathContext mc) { /* numerator and denominator individually rephrased */ BigDecimal n = new BigDecimal(a); BigDecimal d = new BigDecimal(b); return n.divide(d, mc); }
java
public BigDecimal BigDecimalValue(MathContext mc) { /* numerator and denominator individually rephrased */ BigDecimal n = new BigDecimal(a); BigDecimal d = new BigDecimal(b); return n.divide(d, mc); }
[ "public", "BigDecimal", "BigDecimalValue", "(", "MathContext", "mc", ")", "{", "/* numerator and denominator individually rephrased\n */", "BigDecimal", "n", "=", "new", "BigDecimal", "(", "a", ")", ";", "BigDecimal", "d", "=", "new", "BigDecimal", "(", "b", ...
Return a representation as BigDecimal. @param mc the mathematical context which determines precision, rounding mode etc @return A representation as a BigDecimal floating point number.
[ "Return", "a", "representation", "as", "BigDecimal", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L495-L501
128,686
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.toFString
public String toFString(int digits) { if (b.compareTo(BigInteger.ONE) != 0) { MathContext mc = new MathContext(digits, RoundingMode.DOWN); BigDecimal f = (new BigDecimal(a)).divide(new BigDecimal(b), mc); return (f.toString()); } else { return a.toString()...
java
public String toFString(int digits) { if (b.compareTo(BigInteger.ONE) != 0) { MathContext mc = new MathContext(digits, RoundingMode.DOWN); BigDecimal f = (new BigDecimal(a)).divide(new BigDecimal(b), mc); return (f.toString()); } else { return a.toString()...
[ "public", "String", "toFString", "(", "int", "digits", ")", "{", "if", "(", "b", ".", "compareTo", "(", "BigInteger", ".", "ONE", ")", "!=", "0", ")", "{", "MathContext", "mc", "=", "new", "MathContext", "(", "digits", ",", "RoundingMode", ".", "DOWN",...
Return a string in floating point format. @param digits The precision (number of digits) @return The human-readable version in base 10.
[ "Return", "a", "string", "in", "floating", "point", "format", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L510-L518
128,687
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java
Rational.normalize
protected void normalize() { /* compute greatest common divisor of numerator and denominator */ final BigInteger g = a.gcd(b); if (g.compareTo(BigInteger.ONE) > 0) { a = a.divide(g); b = b.divide(g); } if (b.compareTo(BigInteger.ZERO) == -1) { ...
java
protected void normalize() { /* compute greatest common divisor of numerator and denominator */ final BigInteger g = a.gcd(b); if (g.compareTo(BigInteger.ONE) > 0) { a = a.divide(g); b = b.divide(g); } if (b.compareTo(BigInteger.ZERO) == -1) { ...
[ "protected", "void", "normalize", "(", ")", "{", "/* compute greatest common divisor of numerator and denominator\n */", "final", "BigInteger", "g", "=", "a", ".", "gcd", "(", "b", ")", ";", "if", "(", "g", ".", "compareTo", "(", "BigInteger", ".", "ONE", ...
Normalize to coprime numerator and denominator. Also copy a negative sign of the denominator to the numerator.
[ "Normalize", "to", "coprime", "numerator", "and", "denominator", ".", "Also", "copy", "a", "negative", "sign", "of", "the", "denominator", "to", "the", "numerator", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L590-L602
128,688
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/Layer.java
Layer.initializeConstraints
protected void initializeConstraints(Builder<?> builder) { //Note: this has to be done AFTER all constructors have finished - otherwise the required // fields may not yet be set yet List<LayerConstraint> allConstraints = new ArrayList<>(); if (builder.allParamConstraints != null && !init...
java
protected void initializeConstraints(Builder<?> builder) { //Note: this has to be done AFTER all constructors have finished - otherwise the required // fields may not yet be set yet List<LayerConstraint> allConstraints = new ArrayList<>(); if (builder.allParamConstraints != null && !init...
[ "protected", "void", "initializeConstraints", "(", "Builder", "<", "?", ">", "builder", ")", "{", "//Note: this has to be done AFTER all constructors have finished - otherwise the required", "// fields may not yet be set yet", "List", "<", "LayerConstraint", ">", "allConstraints", ...
Initialize the weight constraints. Should be called last, in the outer-most constructor
[ "Initialize", "the", "weight", "constraints", ".", "Should", "be", "called", "last", "in", "the", "outer", "-", "most", "constructor" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/Layer.java#L67-L100
128,689
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-data/deeplearning4j-datasets/src/main/java/org/deeplearning4j/datasets/mnist/MnistLabelFile.java
MnistLabelFile.readLabels
public int[] readLabels(int num) throws IOException { int[] out = new int[num]; for (int i = 0; i < num; i++) out[i] = readLabel(); return out; }
java
public int[] readLabels(int num) throws IOException { int[] out = new int[num]; for (int i = 0; i < num; i++) out[i] = readLabel(); return out; }
[ "public", "int", "[", "]", "readLabels", "(", "int", "num", ")", "throws", "IOException", "{", "int", "[", "]", "out", "=", "new", "int", "[", "num", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "num", ";", "i", "++", ")", "out"...
Read the specified number of labels from the current position
[ "Read", "the", "specified", "number", "of", "labels", "from", "the", "current", "position" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-data/deeplearning4j-datasets/src/main/java/org/deeplearning4j/datasets/mnist/MnistLabelFile.java#L56-L61
128,690
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.asum
@Override public double asum(INDArray arr) { if (arr.isSparse()) { return Nd4j.getSparseBlasWrapper().level1().asum(arr); } if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, arr); ...
java
@Override public double asum(INDArray arr) { if (arr.isSparse()) { return Nd4j.getSparseBlasWrapper().level1().asum(arr); } if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, arr); ...
[ "@", "Override", "public", "double", "asum", "(", "INDArray", "arr", ")", "{", "if", "(", "arr", ".", "isSparse", "(", ")", ")", "{", "return", "Nd4j", ".", "getSparseBlasWrapper", "(", ")", ".", "level1", "(", ")", ".", "asum", "(", "arr", ")", ";...
computes the sum of magnitudes of all vector elements or, for a complex vector x, the sum @param arr @return
[ "computes", "the", "sum", "of", "magnitudes", "of", "all", "vector", "elements", "or", "for", "a", "complex", "vector", "x", "the", "sum" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L127-L146
128,691
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.iamax
@Override public int iamax(INDArray arr) { if (arr.isSparse()) { return Nd4j.getSparseBlasWrapper().level1().iamax(arr); } if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, arr); i...
java
@Override public int iamax(INDArray arr) { if (arr.isSparse()) { return Nd4j.getSparseBlasWrapper().level1().iamax(arr); } if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, arr); i...
[ "@", "Override", "public", "int", "iamax", "(", "INDArray", "arr", ")", "{", "if", "(", "arr", ".", "isSparse", "(", ")", ")", "{", "return", "Nd4j", ".", "getSparseBlasWrapper", "(", ")", ".", "level1", "(", ")", ".", "iamax", "(", "arr", ")", ";"...
finds the element of a vector that has the largest absolute value. @param arr @return
[ "finds", "the", "element", "of", "a", "vector", "that", "has", "the", "largest", "absolute", "value", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L203-L218
128,692
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.iamin
@Override public int iamin(INDArray arr) { if (arr.isSparse()) { return Nd4j.getSparseBlasWrapper().level1().iamin(arr); } else { throw new UnsupportedOperationException(); } }
java
@Override public int iamin(INDArray arr) { if (arr.isSparse()) { return Nd4j.getSparseBlasWrapper().level1().iamin(arr); } else { throw new UnsupportedOperationException(); } }
[ "@", "Override", "public", "int", "iamin", "(", "INDArray", "arr", ")", "{", "if", "(", "arr", ".", "isSparse", "(", ")", ")", "{", "return", "Nd4j", ".", "getSparseBlasWrapper", "(", ")", ".", "level1", "(", ")", ".", "iamin", "(", "arr", ")", ";"...
finds the element of a vector that has the minimum absolute value. @param arr @return
[ "finds", "the", "element", "of", "a", "vector", "that", "has", "the", "minimum", "absolute", "value", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L226-L233
128,693
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.swap
@Override public void swap(INDArray x, INDArray y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, x, y); if (x.isSparse() || y.isSparse()) { Nd4j.getSparseBlasWrapper().level1().swap(x, y); ...
java
@Override public void swap(INDArray x, INDArray y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, x, y); if (x.isSparse() || y.isSparse()) { Nd4j.getSparseBlasWrapper().level1().swap(x, y); ...
[ "@", "Override", "public", "void", "swap", "(", "INDArray", "x", ",", "INDArray", "y", ")", "{", "if", "(", "Nd4j", ".", "getExecutioner", "(", ")", ".", "getProfilingMode", "(", ")", "==", "OpExecutioner", ".", "ProfilingMode", ".", "ALL", ")", "OpProfi...
swaps a vector with another vector. @param x @param y
[ "swaps", "a", "vector", "with", "another", "vector", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L241-L258
128,694
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.copy
@Override public void copy(long n, DataBuffer x, int offsetX, int incrX, DataBuffer y, int offsetY, int incrY) { if (supportsDataBufferL1Ops()) { if (x.dataType() == DataType.DOUBLE) { dcopy(n, x, offsetX, incrX, y, offsetY, incrY); } else { scopy(n,...
java
@Override public void copy(long n, DataBuffer x, int offsetX, int incrX, DataBuffer y, int offsetY, int incrY) { if (supportsDataBufferL1Ops()) { if (x.dataType() == DataType.DOUBLE) { dcopy(n, x, offsetX, incrX, y, offsetY, incrY); } else { scopy(n,...
[ "@", "Override", "public", "void", "copy", "(", "long", "n", ",", "DataBuffer", "x", ",", "int", "offsetX", ",", "int", "incrX", ",", "DataBuffer", "y", ",", "int", "offsetY", ",", "int", "incrY", ")", "{", "if", "(", "supportsDataBufferL1Ops", "(", ")...
copy a vector to another vector.
[ "copy", "a", "vector", "to", "another", "vector", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L287-L306
128,695
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.rotg
@Override public void rotg(INDArray a, INDArray b, INDArray c, INDArray s) { throw new UnsupportedOperationException(); }
java
@Override public void rotg(INDArray a, INDArray b, INDArray c, INDArray s) { throw new UnsupportedOperationException(); }
[ "@", "Override", "public", "void", "rotg", "(", "INDArray", "a", ",", "INDArray", "b", ",", "INDArray", "c", ",", "INDArray", "s", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}" ]
computes parameters for a Givens rotation. @param a @param b @param c @param s
[ "computes", "parameters", "for", "a", "Givens", "rotation", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L367-L370
128,696
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.rot
@Override public void rot(long N, INDArray X, INDArray Y, double c, double s) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, X, Y); if (X.isSparse() && !Y.isSparse()) { Nd4j.getSparseBlasWra...
java
@Override public void rot(long N, INDArray X, INDArray Y, double c, double s) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, X, Y); if (X.isSparse() && !Y.isSparse()) { Nd4j.getSparseBlasWra...
[ "@", "Override", "public", "void", "rot", "(", "long", "N", ",", "INDArray", "X", ",", "INDArray", "Y", ",", "double", "c", ",", "double", "s", ")", "{", "if", "(", "Nd4j", ".", "getExecutioner", "(", ")", ".", "getProfilingMode", "(", ")", "==", "...
performs rotation of points in the plane. @param N @param X @param Y @param c @param s
[ "performs", "rotation", "of", "points", "in", "the", "plane", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L381-L396
128,697
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.rotmg
@Override public void rotmg(INDArray d1, INDArray d2, INDArray b1, double b2, INDArray P) { throw new UnsupportedOperationException(); }
java
@Override public void rotmg(INDArray d1, INDArray d2, INDArray b1, double b2, INDArray P) { throw new UnsupportedOperationException(); }
[ "@", "Override", "public", "void", "rotmg", "(", "INDArray", "d1", ",", "INDArray", "d2", ",", "INDArray", "b1", ",", "double", "b2", ",", "INDArray", "P", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}" ]
computes the modified parameters for a Givens rotation. @param d1 @param d2 @param b1 @param b2 @param P
[ "computes", "the", "modified", "parameters", "for", "a", "Givens", "rotation", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L407-L410
128,698
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java
BaseLevel1.scal
@Override public void scal(long N, double alpha, INDArray X) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, X); if (X.isSparse()) { Nd4j.getSparseBlasWrapper().level1().scal(N, alpha, X); ...
java
@Override public void scal(long N, double alpha, INDArray X) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, X); if (X.isSparse()) { Nd4j.getSparseBlasWrapper().level1().scal(N, alpha, X); ...
[ "@", "Override", "public", "void", "scal", "(", "long", "N", ",", "double", "alpha", ",", "INDArray", "X", ")", "{", "if", "(", "Nd4j", ".", "getExecutioner", "(", ")", ".", "getProfilingMode", "(", ")", "==", "OpExecutioner", ".", "ProfilingMode", ".", ...
computes a vector by a scalar product. @param N @param alpha @param X
[ "computes", "a", "vector", "by", "a", "scalar", "product", "." ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L419-L432
128,699
deeplearning4j/deeplearning4j
datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java
ImageLoader.asRowVector
public INDArray asRowVector(BufferedImage image) { if (centerCropIfNeeded) { image = centerCropIfNeeded(image); } image = scalingIfNeed(image, true); if (channels == 3) { return toINDArrayBGR(image).ravel(); } int[][] ret = toIntArrayArray(image); ...
java
public INDArray asRowVector(BufferedImage image) { if (centerCropIfNeeded) { image = centerCropIfNeeded(image); } image = scalingIfNeed(image, true); if (channels == 3) { return toINDArrayBGR(image).ravel(); } int[][] ret = toIntArrayArray(image); ...
[ "public", "INDArray", "asRowVector", "(", "BufferedImage", "image", ")", "{", "if", "(", "centerCropIfNeeded", ")", "{", "image", "=", "centerCropIfNeeded", "(", "image", ")", ";", "}", "image", "=", "scalingIfNeed", "(", "image", ",", "true", ")", ";", "i...
Convert an image in to a row vector @param image the image to convert @return the row vector based on a rastered representation of the image
[ "Convert", "an", "image", "in", "to", "a", "row", "vector" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java#L131-L141