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,200 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.mmul | @Override
public INDArray mmul(INDArray other, INDArray result, MMulTranspose mMulTranspose) {
return null;
} | java | @Override
public INDArray mmul(INDArray other, INDArray result, MMulTranspose mMulTranspose) {
return null;
} | [
"@",
"Override",
"public",
"INDArray",
"mmul",
"(",
"INDArray",
"other",
",",
"INDArray",
"result",
",",
"MMulTranspose",
"mMulTranspose",
")",
"{",
"return",
"null",
";",
"}"
] | Perform an copy matrix multiplication
@param other the other matrix to perform matrix multiply with
@param result the result ndarray
@param mMulTranspose the transpose status of each array
@return the result of the matrix multiplication | [
"Perform",
"an",
"copy",
"matrix",
"multiplication"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java#L1140-L1143 |
128,201 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java | ModelSerializer.addNormalizerToModel | public static void addNormalizerToModel(File f, Normalizer<?> normalizer) {
File tempFile = null;
try {
// copy existing model to temporary file
tempFile = DL4JFileUtils.createTempFile("dl4jModelSerializerTemp", "bin");
tempFile.deleteOnExit();
Files.copy(... | java | public static void addNormalizerToModel(File f, Normalizer<?> normalizer) {
File tempFile = null;
try {
// copy existing model to temporary file
tempFile = DL4JFileUtils.createTempFile("dl4jModelSerializerTemp", "bin");
tempFile.deleteOnExit();
Files.copy(... | [
"public",
"static",
"void",
"addNormalizerToModel",
"(",
"File",
"f",
",",
"Normalizer",
"<",
"?",
">",
"normalizer",
")",
"{",
"File",
"tempFile",
"=",
"null",
";",
"try",
"{",
"// copy existing model to temporary file",
"tempFile",
"=",
"DL4JFileUtils",
".",
"... | This method appends normalizer to a given persisted model.
PLEASE NOTE: File should be model file saved earlier with ModelSerializer
@param f
@param normalizer | [
"This",
"method",
"appends",
"normalizer",
"to",
"a",
"given",
"persisted",
"model",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java#L731-L772 |
128,202 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java | ModelSerializer.restoreNormalizerFromFile | public static <T extends Normalizer> T restoreNormalizerFromFile(File file) {
try (ZipFile zipFile = new ZipFile(file)) {
ZipEntry norm = zipFile.getEntry(NORMALIZER_BIN);
// checking for file existence
if (norm == null)
return null;
return Norma... | java | public static <T extends Normalizer> T restoreNormalizerFromFile(File file) {
try (ZipFile zipFile = new ZipFile(file)) {
ZipEntry norm = zipFile.getEntry(NORMALIZER_BIN);
// checking for file existence
if (norm == null)
return null;
return Norma... | [
"public",
"static",
"<",
"T",
"extends",
"Normalizer",
">",
"T",
"restoreNormalizerFromFile",
"(",
"File",
"file",
")",
"{",
"try",
"(",
"ZipFile",
"zipFile",
"=",
"new",
"ZipFile",
"(",
"file",
")",
")",
"{",
"ZipEntry",
"norm",
"=",
"zipFile",
".",
"ge... | This method restores normalizer from a given persisted model file
PLEASE NOTE: File should be model file saved earlier with ModelSerializer with addNormalizerToModel being called
@param file
@return | [
"This",
"method",
"restores",
"normalizer",
"from",
"a",
"given",
"persisted",
"model",
"file"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java#L907-L925 |
128,203 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java | ModelSerializer.restoreNormalizerFromInputStream | public static <T extends Normalizer> T restoreNormalizerFromInputStream(InputStream is) throws IOException {
checkInputStream(is);
File tmpFile = null;
try {
tmpFile = tempFileFromStream(is);
return restoreNormalizerFromFile(tmpFile);
} finally {
if(t... | java | public static <T extends Normalizer> T restoreNormalizerFromInputStream(InputStream is) throws IOException {
checkInputStream(is);
File tmpFile = null;
try {
tmpFile = tempFileFromStream(is);
return restoreNormalizerFromFile(tmpFile);
} finally {
if(t... | [
"public",
"static",
"<",
"T",
"extends",
"Normalizer",
">",
"T",
"restoreNormalizerFromInputStream",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"checkInputStream",
"(",
"is",
")",
";",
"File",
"tmpFile",
"=",
"null",
";",
"try",
"{",
"tmpFile... | This method restores the normalizer form a persisted model file.
@param is A stream to load data from.
@return the loaded normalizer | [
"This",
"method",
"restores",
"the",
"normalizer",
"form",
"a",
"persisted",
"model",
"file",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ModelSerializer.java#L934-L946 |
128,204 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/iterator/StandardScaler.java | StandardScaler.load | public void load(File mean, File std) throws IOException {
this.mean = Nd4j.readBinary(mean);
this.std = Nd4j.readBinary(std);
} | java | public void load(File mean, File std) throws IOException {
this.mean = Nd4j.readBinary(mean);
this.std = Nd4j.readBinary(std);
} | [
"public",
"void",
"load",
"(",
"File",
"mean",
",",
"File",
"std",
")",
"throws",
"IOException",
"{",
"this",
".",
"mean",
"=",
"Nd4j",
".",
"readBinary",
"(",
"mean",
")",
";",
"this",
".",
"std",
"=",
"Nd4j",
".",
"readBinary",
"(",
"std",
")",
"... | Load the given mean and std
@param mean the mean file
@param std the std file
@throws IOException | [
"Load",
"the",
"given",
"mean",
"and",
"std"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/iterator/StandardScaler.java#L107-L110 |
128,205 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/iterator/StandardScaler.java | StandardScaler.save | public void save(File mean, File std) throws IOException {
Nd4j.saveBinary(this.mean, mean);
Nd4j.saveBinary(this.std, std);
} | java | public void save(File mean, File std) throws IOException {
Nd4j.saveBinary(this.mean, mean);
Nd4j.saveBinary(this.std, std);
} | [
"public",
"void",
"save",
"(",
"File",
"mean",
",",
"File",
"std",
")",
"throws",
"IOException",
"{",
"Nd4j",
".",
"saveBinary",
"(",
"this",
".",
"mean",
",",
"mean",
")",
";",
"Nd4j",
".",
"saveBinary",
"(",
"this",
".",
"std",
",",
"std",
")",
"... | Save the current mean and std
@param mean the mean
@param std the std
@throws IOException | [
"Save",
"the",
"current",
"mean",
"and",
"std"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/iterator/StandardScaler.java#L118-L121 |
128,206 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/iterator/StandardScaler.java | StandardScaler.transform | public void transform(DataSet dataSet) {
dataSet.setFeatures(dataSet.getFeatures().subRowVector(mean));
dataSet.setFeatures(dataSet.getFeatures().divRowVector(std));
} | java | public void transform(DataSet dataSet) {
dataSet.setFeatures(dataSet.getFeatures().subRowVector(mean));
dataSet.setFeatures(dataSet.getFeatures().divRowVector(std));
} | [
"public",
"void",
"transform",
"(",
"DataSet",
"dataSet",
")",
"{",
"dataSet",
".",
"setFeatures",
"(",
"dataSet",
".",
"getFeatures",
"(",
")",
".",
"subRowVector",
"(",
"mean",
")",
")",
";",
"dataSet",
".",
"setFeatures",
"(",
"dataSet",
".",
"getFeatur... | Transform the data
@param dataSet the dataset to transform | [
"Transform",
"the",
"data"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/iterator/StandardScaler.java#L127-L130 |
128,207 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/NDArrayWritable.java | NDArrayWritable.readFields | public void readFields(DataInput in) throws IOException {
DataInputStream dis = new DataInputStream(new DataInputWrapperStream(in));
byte header = dis.readByte();
if (header != NDARRAY_SER_VERSION_HEADER && header != NDARRAY_SER_VERSION_HEADER_NULL) {
throw new IllegalStateException(... | java | public void readFields(DataInput in) throws IOException {
DataInputStream dis = new DataInputStream(new DataInputWrapperStream(in));
byte header = dis.readByte();
if (header != NDARRAY_SER_VERSION_HEADER && header != NDARRAY_SER_VERSION_HEADER_NULL) {
throw new IllegalStateException(... | [
"public",
"void",
"readFields",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"DataInputStream",
"dis",
"=",
"new",
"DataInputStream",
"(",
"new",
"DataInputWrapperStream",
"(",
"in",
")",
")",
";",
"byte",
"header",
"=",
"dis",
".",
"readByte",
... | Deserialize into a row vector of default type. | [
"Deserialize",
"into",
"a",
"row",
"vector",
"of",
"default",
"type",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/NDArrayWritable.java#L53-L67 |
128,208 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/NDArrayWritable.java | NDArrayWritable.write | public void write(DataOutput out) throws IOException {
if (array == null) {
out.write(NDARRAY_SER_VERSION_HEADER_NULL);
return;
}
INDArray toWrite;
if (array.isView()) {
toWrite = array.dup();
} else {
toWrite = array;
}
... | java | public void write(DataOutput out) throws IOException {
if (array == null) {
out.write(NDARRAY_SER_VERSION_HEADER_NULL);
return;
}
INDArray toWrite;
if (array.isView()) {
toWrite = array.dup();
} else {
toWrite = array;
}
... | [
"public",
"void",
"write",
"(",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"out",
".",
"write",
"(",
"NDARRAY_SER_VERSION_HEADER_NULL",
")",
";",
"return",
";",
"}",
"INDArray",
"toWrite",
";",
"if",... | Serialize array data linearly. | [
"Serialize",
"array",
"data",
"linearly",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/NDArrayWritable.java#L82-L99 |
128,209 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/NesterovsUpdater.java | NesterovsUpdater.applyUpdater | @Override
public void applyUpdater(INDArray gradient, int iteration, int epoch) {
if (v == null)
throw new IllegalStateException("Updater has not been initialized with view state");
double momentum = config.currentMomentum(iteration, epoch);
double learningRate = config.getLearn... | java | @Override
public void applyUpdater(INDArray gradient, int iteration, int epoch) {
if (v == null)
throw new IllegalStateException("Updater has not been initialized with view state");
double momentum = config.currentMomentum(iteration, epoch);
double learningRate = config.getLearn... | [
"@",
"Override",
"public",
"void",
"applyUpdater",
"(",
"INDArray",
"gradient",
",",
"int",
"iteration",
",",
"int",
"epoch",
")",
"{",
"if",
"(",
"v",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Updater has not been initialized with view s... | Get the nesterov update
@param gradient the gradient to get the update for
@param iteration
@return | [
"Get",
"the",
"nesterov",
"update"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/NesterovsUpdater.java#L68-L91 |
128,210 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java | ModelParameterServer.shutdown | public synchronized void shutdown() {
if (stopLock.get())
return;
// shutting down underlying transport
transport.shutdown();
// disposing INDArray flow
disposable.dispose();
updaterParamsSubscribers.clear();
modelParamsSubsribers.clear();
... | java | public synchronized void shutdown() {
if (stopLock.get())
return;
// shutting down underlying transport
transport.shutdown();
// disposing INDArray flow
disposable.dispose();
updaterParamsSubscribers.clear();
modelParamsSubsribers.clear();
... | [
"public",
"synchronized",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"stopLock",
".",
"get",
"(",
")",
")",
"return",
";",
"// shutting down underlying transport",
"transport",
".",
"shutdown",
"(",
")",
";",
"// disposing INDArray flow",
"disposable",
".",
"... | This method stops parameter server | [
"This",
"method",
"stops",
"parameter",
"server"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java#L392-L412 |
128,211 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java | ModelParameterServer.getUpdates | public Collection<INDArray> getUpdates() {
// just drain stuff from the queue
val list = new ArrayList<INDArray>();
updatesQueue.drainTo(list);
return list;
} | java | public Collection<INDArray> getUpdates() {
// just drain stuff from the queue
val list = new ArrayList<INDArray>();
updatesQueue.drainTo(list);
return list;
} | [
"public",
"Collection",
"<",
"INDArray",
">",
"getUpdates",
"(",
")",
"{",
"// just drain stuff from the queue",
"val",
"list",
"=",
"new",
"ArrayList",
"<",
"INDArray",
">",
"(",
")",
";",
"updatesQueue",
".",
"drainTo",
"(",
"list",
")",
";",
"return",
"li... | This method returns updates received from network
@return | [
"This",
"method",
"returns",
"updates",
"received",
"from",
"network"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java#L438-L443 |
128,212 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java | ViterbiBuilder.build | public ViterbiLattice build(String text) {
int textLength = text.length();
ViterbiLattice lattice = new ViterbiLattice(textLength + 2);
lattice.addBos();
int unknownWordEndIndex = -1; // index of the last character of unknown word
for (int startIndex = 0; startIndex < textLeng... | java | public ViterbiLattice build(String text) {
int textLength = text.length();
ViterbiLattice lattice = new ViterbiLattice(textLength + 2);
lattice.addBos();
int unknownWordEndIndex = -1; // index of the last character of unknown word
for (int startIndex = 0; startIndex < textLeng... | [
"public",
"ViterbiLattice",
"build",
"(",
"String",
"text",
")",
"{",
"int",
"textLength",
"=",
"text",
".",
"length",
"(",
")",
";",
"ViterbiLattice",
"lattice",
"=",
"new",
"ViterbiLattice",
"(",
"textLength",
"+",
"2",
")",
";",
"lattice",
".",
"addBos"... | Build lattice from input text
@param text source text for the lattice
@return built lattice, not null | [
"Build",
"lattice",
"from",
"input",
"text"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L70-L106 |
128,213 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java | ViterbiBuilder.repairBrokenLatticeBefore | private void repairBrokenLatticeBefore(ViterbiLattice lattice, int index) {
ViterbiNode[][] nodeStartIndices = lattice.getStartIndexArr();
for (int startIndex = index; startIndex > 0; startIndex--) {
if (nodeStartIndices[startIndex] != null) {
ViterbiNode glueBase = findGlue... | java | private void repairBrokenLatticeBefore(ViterbiLattice lattice, int index) {
ViterbiNode[][] nodeStartIndices = lattice.getStartIndexArr();
for (int startIndex = index; startIndex > 0; startIndex--) {
if (nodeStartIndices[startIndex] != null) {
ViterbiNode glueBase = findGlue... | [
"private",
"void",
"repairBrokenLatticeBefore",
"(",
"ViterbiLattice",
"lattice",
",",
"int",
"index",
")",
"{",
"ViterbiNode",
"[",
"]",
"[",
"]",
"nodeStartIndices",
"=",
"lattice",
".",
"getStartIndexArr",
"(",
")",
";",
"for",
"(",
"int",
"startIndex",
"="... | Tries to repair the lattice by creating and adding an additional Viterbi node to the LEFT of the newly
inserted user dictionary entry by using the substring of the node in the lattice that overlaps the least
@param lattice
@param index | [
"Tries",
"to",
"repair",
"the",
"lattice",
"by",
"creating",
"and",
"adding",
"an",
"additional",
"Viterbi",
"node",
"to",
"the",
"LEFT",
"of",
"the",
"newly",
"inserted",
"user",
"dictionary",
"entry",
"by",
"using",
"the",
"substring",
"of",
"the",
"node",... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L237-L252 |
128,214 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java | ViterbiBuilder.repairBrokenLatticeAfter | private void repairBrokenLatticeAfter(ViterbiLattice lattice, int nodeEndIndex) {
ViterbiNode[][] nodeEndIndices = lattice.getEndIndexArr();
for (int endIndex = nodeEndIndex + 1; endIndex < nodeEndIndices.length; endIndex++) {
if (nodeEndIndices[endIndex] != null) {
ViterbiN... | java | private void repairBrokenLatticeAfter(ViterbiLattice lattice, int nodeEndIndex) {
ViterbiNode[][] nodeEndIndices = lattice.getEndIndexArr();
for (int endIndex = nodeEndIndex + 1; endIndex < nodeEndIndices.length; endIndex++) {
if (nodeEndIndices[endIndex] != null) {
ViterbiN... | [
"private",
"void",
"repairBrokenLatticeAfter",
"(",
"ViterbiLattice",
"lattice",
",",
"int",
"nodeEndIndex",
")",
"{",
"ViterbiNode",
"[",
"]",
"[",
"]",
"nodeEndIndices",
"=",
"lattice",
".",
"getEndIndexArr",
"(",
")",
";",
"for",
"(",
"int",
"endIndex",
"="... | Tries to repair the lattice by creating and adding an additional Viterbi node to the RIGHT of the newly
inserted user dictionary entry by using the substring of the node in the lattice that overlaps the least
@param lattice
@param nodeEndIndex | [
"Tries",
"to",
"repair",
"the",
"lattice",
"by",
"creating",
"and",
"adding",
"an",
"additional",
"Viterbi",
"node",
"to",
"the",
"RIGHT",
"of",
"the",
"newly",
"inserted",
"user",
"dictionary",
"entry",
"by",
"using",
"the",
"substring",
"of",
"the",
"node"... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L260-L276 |
128,215 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java | ViterbiBuilder.findGlueNodeCandidate | private ViterbiNode findGlueNodeCandidate(int index, ViterbiNode[] latticeNodes, int startIndex) {
List<ViterbiNode> candidates = new ArrayList<>();
for (ViterbiNode viterbiNode : latticeNodes) {
if (viterbiNode != null) {
candidates.add(viterbiNode);
}
}... | java | private ViterbiNode findGlueNodeCandidate(int index, ViterbiNode[] latticeNodes, int startIndex) {
List<ViterbiNode> candidates = new ArrayList<>();
for (ViterbiNode viterbiNode : latticeNodes) {
if (viterbiNode != null) {
candidates.add(viterbiNode);
}
}... | [
"private",
"ViterbiNode",
"findGlueNodeCandidate",
"(",
"int",
"index",
",",
"ViterbiNode",
"[",
"]",
"latticeNodes",
",",
"int",
"startIndex",
")",
"{",
"List",
"<",
"ViterbiNode",
">",
"candidates",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",... | Tries to locate a candidate for a "glue" node that repairs the broken lattice by looking at all nodes at the
current index.
@param index
@param latticeNodes
@param startIndex
@return new ViterbiNode that can be inserted to glue the graph if such a node exists, else null | [
"Tries",
"to",
"locate",
"a",
"candidate",
"for",
"a",
"glue",
"node",
"that",
"repairs",
"the",
"broken",
"lattice",
"by",
"looking",
"at",
"all",
"nodes",
"at",
"the",
"current",
"index",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L287-L308 |
128,216 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java | ViterbiBuilder.isAcceptableCandidate | private boolean isAcceptableCandidate(int targetLength, ViterbiNode glueBase, ViterbiNode candidate) {
return (glueBase == null || candidate.getSurface().length() < glueBase.getSurface().length())
&& candidate.getSurface().length() >= targetLength;
} | java | private boolean isAcceptableCandidate(int targetLength, ViterbiNode glueBase, ViterbiNode candidate) {
return (glueBase == null || candidate.getSurface().length() < glueBase.getSurface().length())
&& candidate.getSurface().length() >= targetLength;
} | [
"private",
"boolean",
"isAcceptableCandidate",
"(",
"int",
"targetLength",
",",
"ViterbiNode",
"glueBase",
",",
"ViterbiNode",
"candidate",
")",
"{",
"return",
"(",
"glueBase",
"==",
"null",
"||",
"candidate",
".",
"getSurface",
"(",
")",
".",
"length",
"(",
"... | Check whether a candidate for a glue node is acceptable.
The candidate should be as short as possible, but long enough to overlap with the inserted user entry
@param targetLength
@param glueBase
@param candidate
@return whether candidate is acceptable | [
"Check",
"whether",
"a",
"candidate",
"for",
"a",
"glue",
"node",
"is",
"acceptable",
".",
"The",
"candidate",
"should",
"be",
"as",
"short",
"as",
"possible",
"but",
"long",
"enough",
"to",
"overlap",
"with",
"the",
"inserted",
"user",
"entry"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L319-L322 |
128,217 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java | ViterbiBuilder.createGlueNode | private ViterbiNode createGlueNode(int startIndex, ViterbiNode glueBase, String surface) {
return new ViterbiNode(glueBase.getWordId(), surface, glueBase.getLeftId(), glueBase.getRightId(),
glueBase.getWordCost(), startIndex, ViterbiNode.Type.INSERTED);
} | java | private ViterbiNode createGlueNode(int startIndex, ViterbiNode glueBase, String surface) {
return new ViterbiNode(glueBase.getWordId(), surface, glueBase.getLeftId(), glueBase.getRightId(),
glueBase.getWordCost(), startIndex, ViterbiNode.Type.INSERTED);
} | [
"private",
"ViterbiNode",
"createGlueNode",
"(",
"int",
"startIndex",
",",
"ViterbiNode",
"glueBase",
",",
"String",
"surface",
")",
"{",
"return",
"new",
"ViterbiNode",
"(",
"glueBase",
".",
"getWordId",
"(",
")",
",",
"surface",
",",
"glueBase",
".",
"getLef... | Create a glue node to be inserted based on ViterbiNode already in the lattice.
The new node takes the same parameters as the node it is based on, but the word is truncated to match the
hole in the lattice caused by the new user entry
@param startIndex
@param glueBase
@param surface
@return new ViterbiNode to be insert... | [
"Create",
"a",
"glue",
"node",
"to",
"be",
"inserted",
"based",
"on",
"ViterbiNode",
"already",
"in",
"the",
"lattice",
".",
"The",
"new",
"node",
"takes",
"the",
"same",
"parameters",
"as",
"the",
"node",
"it",
"is",
"based",
"on",
"but",
"the",
"word",... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L334-L337 |
128,218 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java | CounterMap.isEmpty | public boolean isEmpty(F element){
if (isEmpty())
return true;
Counter<S> m = maps.get(element);
if (m == null)
return true;
else
return m.isEmpty();
} | java | public boolean isEmpty(F element){
if (isEmpty())
return true;
Counter<S> m = maps.get(element);
if (m == null)
return true;
else
return m.isEmpty();
} | [
"public",
"boolean",
"isEmpty",
"(",
"F",
"element",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"return",
"true",
";",
"Counter",
"<",
"S",
">",
"m",
"=",
"maps",
".",
"get",
"(",
"element",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"ret... | This method checks if this CounterMap has any values stored for a given first element
@param element
@return | [
"This",
"method",
"checks",
"if",
"this",
"CounterMap",
"has",
"any",
"values",
"stored",
"for",
"a",
"given",
"first",
"element"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java#L56-L65 |
128,219 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java | CounterMap.incrementAll | public void incrementAll(CounterMap<F, S> other) {
for (Map.Entry<F, Counter<S>> entry : other.maps.entrySet()) {
F key = entry.getKey();
Counter<S> innerCounter = entry.getValue();
for (Map.Entry<S, AtomicDouble> innerEntry : innerCounter.entrySet()) {
S valu... | java | public void incrementAll(CounterMap<F, S> other) {
for (Map.Entry<F, Counter<S>> entry : other.maps.entrySet()) {
F key = entry.getKey();
Counter<S> innerCounter = entry.getValue();
for (Map.Entry<S, AtomicDouble> innerEntry : innerCounter.entrySet()) {
S valu... | [
"public",
"void",
"incrementAll",
"(",
"CounterMap",
"<",
"F",
",",
"S",
">",
"other",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"F",
",",
"Counter",
"<",
"S",
">",
">",
"entry",
":",
"other",
".",
"maps",
".",
"entrySet",
"(",
")",
")",
... | This method will increment values of this counter, by counts of other counter
@param other | [
"This",
"method",
"will",
"increment",
"values",
"of",
"this",
"counter",
"by",
"counts",
"of",
"other",
"counter"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java#L72-L81 |
128,220 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java | CounterMap.argMax | public Pair<F, S> argMax() {
Double maxCount = -Double.MAX_VALUE;
Pair<F, S> maxKey = null;
for (Map.Entry<F, Counter<S>> entry : maps.entrySet()) {
Counter<S> counter = entry.getValue();
S localMax = counter.argMax();
if (counter.getCount(localMax) > maxCount... | java | public Pair<F, S> argMax() {
Double maxCount = -Double.MAX_VALUE;
Pair<F, S> maxKey = null;
for (Map.Entry<F, Counter<S>> entry : maps.entrySet()) {
Counter<S> counter = entry.getValue();
S localMax = counter.argMax();
if (counter.getCount(localMax) > maxCount... | [
"public",
"Pair",
"<",
"F",
",",
"S",
">",
"argMax",
"(",
")",
"{",
"Double",
"maxCount",
"=",
"-",
"Double",
".",
"MAX_VALUE",
";",
"Pair",
"<",
"F",
",",
"S",
">",
"maxKey",
"=",
"null",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"F",
",",
... | This method returns pair of elements with a max value
@return | [
"This",
"method",
"returns",
"pair",
"of",
"elements",
"with",
"a",
"max",
"value"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java#L138-L150 |
128,221 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java | CounterMap.clear | public void clear(F element) {
Counter<S> s = maps.get(element);
if (s != null)
s.clear();
} | java | public void clear(F element) {
Counter<S> s = maps.get(element);
if (s != null)
s.clear();
} | [
"public",
"void",
"clear",
"(",
"F",
"element",
")",
"{",
"Counter",
"<",
"S",
">",
"s",
"=",
"maps",
".",
"get",
"(",
"element",
")",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"s",
".",
"clear",
"(",
")",
";",
"}"
] | This method purges counter for a given first element
@param element | [
"This",
"method",
"purges",
"counter",
"for",
"a",
"given",
"first",
"element"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java#L163-L167 |
128,222 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java | CounterMap.totalSize | public int totalSize() {
int size = 0;
for (F first: keySet()) {
size += getCounter(first).size();
}
return size;
} | java | public int totalSize() {
int size = 0;
for (F first: keySet()) {
size += getCounter(first).size();
}
return size;
} | [
"public",
"int",
"totalSize",
"(",
")",
"{",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"F",
"first",
":",
"keySet",
"(",
")",
")",
"{",
"size",
"+=",
"getCounter",
"(",
"first",
")",
".",
"size",
"(",
")",
";",
"}",
"return",
"size",
";",
"}"
] | This method returns total number of elements in this CounterMap
@return | [
"This",
"method",
"returns",
"total",
"number",
"of",
"elements",
"in",
"this",
"CounterMap"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java#L244-L251 |
128,223 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java | BaseLevel2.tpsv | @Override
public void tpsv(char order, char Uplo, char TransA, char Diag, INDArray Ap, INDArray X) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, Ap, X);
// FIXME: int cast
if (X.data().dataType... | java | @Override
public void tpsv(char order, char Uplo, char TransA, char Diag, INDArray Ap, INDArray X) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, Ap, X);
// FIXME: int cast
if (X.data().dataType... | [
"@",
"Override",
"public",
"void",
"tpsv",
"(",
"char",
"order",
",",
"char",
"Uplo",
",",
"char",
"TransA",
",",
"char",
"Diag",
",",
"INDArray",
"Ap",
",",
"INDArray",
"X",
")",
"{",
"if",
"(",
"Nd4j",
".",
"getExecutioner",
"(",
")",
".",
"getProf... | tpsv solves a system of linear equations whose coefficients are in a triangular packed matrix.
@param order
@param Uplo
@param TransA
@param Diag
@param Ap
@param X | [
"tpsv",
"solves",
"a",
"system",
"of",
"linear",
"equations",
"whose",
"coefficients",
"are",
"in",
"a",
"triangular",
"packed",
"matrix",
"."
] | 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/BaseLevel2.java#L460-L476 |
128,224 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/properties/FingerprintProperties.java | FingerprintProperties.getInstance | public static FingerprintProperties getInstance() {
if (instance == null) {
synchronized (FingerprintProperties.class) {
if (instance == null) {
instance = new FingerprintProperties();
}
}
}
return instance;
} | java | public static FingerprintProperties getInstance() {
if (instance == null) {
synchronized (FingerprintProperties.class) {
if (instance == null) {
instance = new FingerprintProperties();
}
}
}
return instance;
} | [
"public",
"static",
"FingerprintProperties",
"getInstance",
"(",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"synchronized",
"(",
"FingerprintProperties",
".",
"class",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"instance",
"=",
... | num frequency units | [
"num",
"frequency",
"units"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/properties/FingerprintProperties.java#L42-L51 |
128,225 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java | TrainModule.listSessions | private Result listSessions() {
StringBuilder sb = new StringBuilder("<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"utf-8\">\n" +
" <title>Training sessions - DL4J Training UI</title>\n" +
... | java | private Result listSessions() {
StringBuilder sb = new StringBuilder("<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<head>\n" +
" <meta charset=\"utf-8\">\n" +
" <title>Training sessions - DL4J Training UI</title>\n" +
... | [
"private",
"Result",
"listSessions",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"<!DOCTYPE html>\\n\"",
"+",
"\"<html lang=\\\"en\\\">\\n\"",
"+",
"\"<head>\\n\"",
"+",
"\" <meta charset=\\\"utf-8\\\">\\n\"",
"+",
"\" <title>Traini... | List training sessions
@return HTML list of training sessions | [
"List",
"training",
"sessions"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java#L203-L229 |
128,226 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java | TrainModule.sessionNotFound | private Result sessionNotFound(String sessionId, String targetPath) {
if (sessionLoader != null && sessionLoader.apply(sessionId)) {
if (targetPath != null) {
return temporaryRedirect("./" + targetPath);
} else {
return ok();
}
} else ... | java | private Result sessionNotFound(String sessionId, String targetPath) {
if (sessionLoader != null && sessionLoader.apply(sessionId)) {
if (targetPath != null) {
return temporaryRedirect("./" + targetPath);
} else {
return ok();
}
} else ... | [
"private",
"Result",
"sessionNotFound",
"(",
"String",
"sessionId",
",",
"String",
"targetPath",
")",
"{",
"if",
"(",
"sessionLoader",
"!=",
"null",
"&&",
"sessionLoader",
".",
"apply",
"(",
"sessionId",
")",
")",
"{",
"if",
"(",
"targetPath",
"!=",
"null",
... | Load StatsStorage via provider, or return "not found"
@param sessionId session ID to look fo with provider
@param targetPath one of overview / model / system, or null
@return temporaryRedirect, ok, or notFound | [
"Load",
"StatsStorage",
"via",
"provider",
"or",
"return",
"not",
"found"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java#L237-L248 |
128,227 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java | TrainModule.getLastUpdateTime | private Long getLastUpdateTime(String sessionId) {
if (lastUpdateForSession != null && sessionId != null && lastUpdateForSession.containsKey(sessionId)) {
return lastUpdateForSession.get(sessionId);
} else {
return -1L;
}
} | java | private Long getLastUpdateTime(String sessionId) {
if (lastUpdateForSession != null && sessionId != null && lastUpdateForSession.containsKey(sessionId)) {
return lastUpdateForSession.get(sessionId);
} else {
return -1L;
}
} | [
"private",
"Long",
"getLastUpdateTime",
"(",
"String",
"sessionId",
")",
"{",
"if",
"(",
"lastUpdateForSession",
"!=",
"null",
"&&",
"sessionId",
"!=",
"null",
"&&",
"lastUpdateForSession",
".",
"containsKey",
"(",
"sessionId",
")",
")",
"{",
"return",
"lastUpda... | Get last update time for given session ID, checking for null values
@param sessionId session ID
@return last update time for session if found, or {@code null} | [
"Get",
"last",
"update",
"time",
"for",
"given",
"session",
"ID",
"checking",
"for",
"null",
"values"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java#L540-L546 |
128,228 | deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArrayPublisher.java | AeronNDArrayPublisher.publish | public void publish(NDArrayMessage message) throws Exception {
if (!init)
init();
// Create a context, needed for client connection to media driver
// A separate media driver process needs to be running prior to starting this application
// Create an Aeron instance with clie... | java | public void publish(NDArrayMessage message) throws Exception {
if (!init)
init();
// Create a context, needed for client connection to media driver
// A separate media driver process needs to be running prior to starting this application
// Create an Aeron instance with clie... | [
"public",
"void",
"publish",
"(",
"NDArrayMessage",
"message",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"init",
")",
"init",
"(",
")",
";",
"// Create a context, needed for client connection to media driver",
"// A separate media driver process needs to be running pri... | Publish an ndarray
to an aeron channel
@param message
@throws Exception | [
"Publish",
"an",
"ndarray",
"to",
"an",
"aeron",
"channel"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArrayPublisher.java#L76-L143 |
128,229 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/glove/count/ASCIICoOccurrenceReader.java | ASCIICoOccurrenceReader.nextObject | @Override
public CoOccurrenceWeight<T> nextObject() {
String line = iterator.nextSentence();
if (line == null || line.isEmpty()) {
return null;
}
String[] strings = line.split(" ");
CoOccurrenceWeight<T> object = new CoOccurrenceWeight<>();
object.setElem... | java | @Override
public CoOccurrenceWeight<T> nextObject() {
String line = iterator.nextSentence();
if (line == null || line.isEmpty()) {
return null;
}
String[] strings = line.split(" ");
CoOccurrenceWeight<T> object = new CoOccurrenceWeight<>();
object.setElem... | [
"@",
"Override",
"public",
"CoOccurrenceWeight",
"<",
"T",
">",
"nextObject",
"(",
")",
"{",
"String",
"line",
"=",
"iterator",
".",
"nextSentence",
"(",
")",
";",
"if",
"(",
"line",
"==",
"null",
"||",
"line",
".",
"isEmpty",
"(",
")",
")",
"{",
"re... | Returns next CoOccurrenceWeight object
PLEASE NOTE: This method can return null value.
@return | [
"Returns",
"next",
"CoOccurrenceWeight",
"object"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/glove/count/ASCIICoOccurrenceReader.java#L61-L75 |
128,230 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/ComputationGraphConfiguration.java | ComputationGraphConfiguration.fromJson | public static ComputationGraphConfiguration fromJson(String json) {
//As per MultiLayerConfiguration.fromJson()
ObjectMapper mapper = NeuralNetConfiguration.mapper();
ComputationGraphConfiguration conf;
try {
conf = mapper.readValue(json, ComputationGraphConfiguration.class);... | java | public static ComputationGraphConfiguration fromJson(String json) {
//As per MultiLayerConfiguration.fromJson()
ObjectMapper mapper = NeuralNetConfiguration.mapper();
ComputationGraphConfiguration conf;
try {
conf = mapper.readValue(json, ComputationGraphConfiguration.class);... | [
"public",
"static",
"ComputationGraphConfiguration",
"fromJson",
"(",
"String",
"json",
")",
"{",
"//As per MultiLayerConfiguration.fromJson()",
"ObjectMapper",
"mapper",
"=",
"NeuralNetConfiguration",
".",
"mapper",
"(",
")",
";",
"ComputationGraphConfiguration",
"conf",
"... | Create a computation graph configuration from json
@param json the neural net configuration from json
@return {@link ComputationGraphConfiguration} | [
"Create",
"a",
"computation",
"graph",
"configuration",
"from",
"json"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/ComputationGraphConfiguration.java#L169-L240 |
128,231 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/ComputationGraphConfiguration.java | ComputationGraphConfiguration.validate | public void validate(boolean allowDisconnected, boolean allowNoOutput){
if (networkInputs == null || networkInputs.isEmpty()) {
throw new IllegalStateException( "Invalid configuration: network has no inputs. " +
"Use .addInputs(String...) to label (and give an ordering to) the n... | java | public void validate(boolean allowDisconnected, boolean allowNoOutput){
if (networkInputs == null || networkInputs.isEmpty()) {
throw new IllegalStateException( "Invalid configuration: network has no inputs. " +
"Use .addInputs(String...) to label (and give an ordering to) the n... | [
"public",
"void",
"validate",
"(",
"boolean",
"allowDisconnected",
",",
"boolean",
"allowNoOutput",
")",
"{",
"if",
"(",
"networkInputs",
"==",
"null",
"||",
"networkInputs",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"... | Check the configuration, make sure it is valid
@param allowDisconnected If true: don't throw an exception on vertices that are 'disconnected'. A disconnected
vertex is one that is not an output, and doesn't connect to any other vertices. i.e.,
it's output activations don't go anywhere
@throws IllegalStateException if ... | [
"Check",
"the",
"configuration",
"make",
"sure",
"it",
"is",
"valid"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/ComputationGraphConfiguration.java#L346-L414 |
128,232 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/NormalizerMinMaxScaler.java | NormalizerMinMaxScaler.load | public void load(File... statistics) throws IOException {
setFeatureStats(new MinMaxStats(Nd4j.readBinary(statistics[0]), Nd4j.readBinary(statistics[1])));
if (isFitLabel()) {
setLabelStats(new MinMaxStats(Nd4j.readBinary(statistics[2]), Nd4j.readBinary(statistics[3])));
}
} | java | public void load(File... statistics) throws IOException {
setFeatureStats(new MinMaxStats(Nd4j.readBinary(statistics[0]), Nd4j.readBinary(statistics[1])));
if (isFitLabel()) {
setLabelStats(new MinMaxStats(Nd4j.readBinary(statistics[2]), Nd4j.readBinary(statistics[3])));
}
} | [
"public",
"void",
"load",
"(",
"File",
"...",
"statistics",
")",
"throws",
"IOException",
"{",
"setFeatureStats",
"(",
"new",
"MinMaxStats",
"(",
"Nd4j",
".",
"readBinary",
"(",
"statistics",
"[",
"0",
"]",
")",
",",
"Nd4j",
".",
"readBinary",
"(",
"statis... | Load the given min and max
@param statistics the statistics to load
@throws IOException | [
"Load",
"the",
"given",
"min",
"and",
"max"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/NormalizerMinMaxScaler.java#L90-L95 |
128,233 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/NormalizerMinMaxScaler.java | NormalizerMinMaxScaler.save | public void save(File... files) throws IOException {
Nd4j.saveBinary(getMin(), files[0]);
Nd4j.saveBinary(getMax(), files[1]);
if (isFitLabel()) {
Nd4j.saveBinary(getLabelMin(), files[2]);
Nd4j.saveBinary(getLabelMax(), files[3]);
}
} | java | public void save(File... files) throws IOException {
Nd4j.saveBinary(getMin(), files[0]);
Nd4j.saveBinary(getMax(), files[1]);
if (isFitLabel()) {
Nd4j.saveBinary(getLabelMin(), files[2]);
Nd4j.saveBinary(getLabelMax(), files[3]);
}
} | [
"public",
"void",
"save",
"(",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"Nd4j",
".",
"saveBinary",
"(",
"getMin",
"(",
")",
",",
"files",
"[",
"0",
"]",
")",
";",
"Nd4j",
".",
"saveBinary",
"(",
"getMax",
"(",
")",
",",
"files",
"... | Save the current min and max
@param files the statistics to save
@throws IOException
@deprecated use {@link NormalizerSerializer instead} | [
"Save",
"the",
"current",
"min",
"and",
"max"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/NormalizerMinMaxScaler.java#L104-L111 |
128,234 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/versioncheck/VersionCheck.java | VersionCheck.versionInfoString | public static String versionInfoString(Detail detail) {
StringBuilder sb = new StringBuilder();
for(VersionInfo grp : getVersionInfos()){
sb.append(grp.getGroupId()).append(" : ").append(grp.getArtifactId()).append(" : ").append(grp.getBuildVersion());
switch (detail){
... | java | public static String versionInfoString(Detail detail) {
StringBuilder sb = new StringBuilder();
for(VersionInfo grp : getVersionInfos()){
sb.append(grp.getGroupId()).append(" : ").append(grp.getArtifactId()).append(" : ").append(grp.getBuildVersion());
switch (detail){
... | [
"public",
"static",
"String",
"versionInfoString",
"(",
"Detail",
"detail",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"VersionInfo",
"grp",
":",
"getVersionInfos",
"(",
")",
")",
"{",
"sb",
".",
"append",
"(",... | Get the version information for dependencies as a string with a specified amount of detail
@param detail Detail level for the version information. See {@link Detail}
@return Version information, as a String | [
"Get",
"the",
"version",
"information",
"for",
"dependencies",
"as",
"a",
"string",
"with",
"a",
"specified",
"amount",
"of",
"detail"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/versioncheck/VersionCheck.java#L325-L341 |
128,235 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/versioncheck/VersionCheck.java | VersionCheck.logVersionInfo | public static void logVersionInfo(Detail detail){
List<VersionInfo> info = getVersionInfos();
for(VersionInfo grp : info){
switch (detail){
case GAV:
log.info("{} : {} : {}", grp.getGroupId(), grp.getArtifactId(), grp.getBuildVersion());
... | java | public static void logVersionInfo(Detail detail){
List<VersionInfo> info = getVersionInfos();
for(VersionInfo grp : info){
switch (detail){
case GAV:
log.info("{} : {} : {}", grp.getGroupId(), grp.getArtifactId(), grp.getBuildVersion());
... | [
"public",
"static",
"void",
"logVersionInfo",
"(",
"Detail",
"detail",
")",
"{",
"List",
"<",
"VersionInfo",
">",
"info",
"=",
"getVersionInfos",
"(",
")",
";",
"for",
"(",
"VersionInfo",
"grp",
":",
"info",
")",
"{",
"switch",
"(",
"detail",
")",
"{",
... | Log the version information with the specified level of detail
@param detail Level of detail for logging | [
"Log",
"the",
"version",
"information",
"with",
"the",
"specified",
"level",
"of",
"detail"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/versioncheck/VersionCheck.java#L354-L374 |
128,236 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/convolutional/KerasConvolution.java | KerasConvolution.getConvParameterValues | public INDArray getConvParameterValues(INDArray kerasParamValue) throws InvalidKerasConfigurationException {
INDArray paramValue;
switch (this.getDimOrder()) {
case TENSORFLOW:
if (kerasParamValue.rank() == 5)
// CNN 3D case
paramValue ... | java | public INDArray getConvParameterValues(INDArray kerasParamValue) throws InvalidKerasConfigurationException {
INDArray paramValue;
switch (this.getDimOrder()) {
case TENSORFLOW:
if (kerasParamValue.rank() == 5)
// CNN 3D case
paramValue ... | [
"public",
"INDArray",
"getConvParameterValues",
"(",
"INDArray",
"kerasParamValue",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"INDArray",
"paramValue",
";",
"switch",
"(",
"this",
".",
"getDimOrder",
"(",
")",
")",
"{",
"case",
"TENSORFLOW",
":",
"if... | Return processed parameter values obtained from Keras convolutional layers.
@param kerasParamValue INDArray containing raw Keras weights to be processed
@return Processed weights, according to which backend was used.
@throws InvalidKerasConfigurationException Invalid Keras configuration exception. | [
"Return",
"processed",
"parameter",
"values",
"obtained",
"from",
"Keras",
"convolutional",
"layers",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/convolutional/KerasConvolution.java#L130-L161 |
128,237 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-native-api/src/main/java/org/nd4j/nativeblas/Nd4jBlas.java | Nd4jBlas.getBlasVendor | @Override
public Vendor getBlasVendor() {
int vendor = getBlasVendorId();
boolean isUnknowVendor = ((vendor > Vendor.values().length - 1) || (vendor <= 0));
if (isUnknowVendor) {
return Vendor.UNKNOWN;
}
return Vendor.values()[vendor];
} | java | @Override
public Vendor getBlasVendor() {
int vendor = getBlasVendorId();
boolean isUnknowVendor = ((vendor > Vendor.values().length - 1) || (vendor <= 0));
if (isUnknowVendor) {
return Vendor.UNKNOWN;
}
return Vendor.values()[vendor];
} | [
"@",
"Override",
"public",
"Vendor",
"getBlasVendor",
"(",
")",
"{",
"int",
"vendor",
"=",
"getBlasVendorId",
"(",
")",
";",
"boolean",
"isUnknowVendor",
"=",
"(",
"(",
"vendor",
">",
"Vendor",
".",
"values",
"(",
")",
".",
"length",
"-",
"1",
")",
"||... | Returns the BLAS library vendor
@return the BLAS library vendor | [
"Returns",
"the",
"BLAS",
"library",
"vendor"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-native-api/src/main/java/org/nd4j/nativeblas/Nd4jBlas.java#L63-L71 |
128,238 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java | Configuration.setIfUnset | public void setIfUnset(String name, String value) {
if (get(name) == null) {
set(name, value);
}
} | java | public void setIfUnset(String name, String value) {
if (get(name) == null) {
set(name, value);
}
} | [
"public",
"void",
"setIfUnset",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"get",
"(",
"name",
")",
"==",
"null",
")",
"{",
"set",
"(",
"name",
",",
"value",
")",
";",
"}",
"}"
] | Sets a property if it is currently unset.
@param name the property name
@param value the new value | [
"Sets",
"a",
"property",
"if",
"it",
"is",
"currently",
"unset",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java#L437-L441 |
128,239 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/records/reader/impl/transform/TransformProcessRecordReader.java | TransformProcessRecordReader.hasNext | @Override
public boolean hasNext() {
if(next != null){
return true;
}
if(!recordReader.hasNext()){
return false;
}
//Prefetch, until we find one that isn't filtered out - or we run out of data
while(next == null && recordReader.hasNext()){
... | java | @Override
public boolean hasNext() {
if(next != null){
return true;
}
if(!recordReader.hasNext()){
return false;
}
//Prefetch, until we find one that isn't filtered out - or we run out of data
while(next == null && recordReader.hasNext()){
... | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"if",
"(",
"next",
"!=",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"recordReader",
".",
"hasNext",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"//Prefetch, until... | Whether there are anymore records
@return | [
"Whether",
"there",
"are",
"anymore",
"records"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/records/reader/impl/transform/TransformProcessRecordReader.java#L120-L140 |
128,240 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/cluster/ClusterUtils.java | ClusterUtils.classifyPoints | public static ClusterSetInfo classifyPoints(final ClusterSet clusterSet, List<Point> points,
ExecutorService executorService) {
final ClusterSetInfo clusterSetInfo = ClusterSetInfo.initialize(clusterSet, true);
List<Runnable> tasks = new ArrayList<>();
for (final Point point... | java | public static ClusterSetInfo classifyPoints(final ClusterSet clusterSet, List<Point> points,
ExecutorService executorService) {
final ClusterSetInfo clusterSetInfo = ClusterSetInfo.initialize(clusterSet, true);
List<Runnable> tasks = new ArrayList<>();
for (final Point point... | [
"public",
"static",
"ClusterSetInfo",
"classifyPoints",
"(",
"final",
"ClusterSet",
"clusterSet",
",",
"List",
"<",
"Point",
">",
"points",
",",
"ExecutorService",
"executorService",
")",
"{",
"final",
"ClusterSetInfo",
"clusterSetInfo",
"=",
"ClusterSetInfo",
".",
... | Classify the set of points base on cluster centers. This also adds each point to the ClusterSet | [
"Classify",
"the",
"set",
"of",
"points",
"base",
"on",
"cluster",
"centers",
".",
"This",
"also",
"adds",
"each",
"point",
"to",
"the",
"ClusterSet"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/cluster/ClusterUtils.java#L49-L71 |
128,241 | deeplearning4j/deeplearning4j | nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java | BaseLoader.convert | @Override
public Blob convert(INDArray toConvert) throws SQLException {
ByteBuffer byteBuffer = BinarySerde.toByteBuffer(toConvert);
Buffer buffer = (Buffer) byteBuffer;
buffer.rewind();
byte[] arr = new byte[byteBuffer.capacity()];
byteBuffer.get(arr);
Connection c =... | java | @Override
public Blob convert(INDArray toConvert) throws SQLException {
ByteBuffer byteBuffer = BinarySerde.toByteBuffer(toConvert);
Buffer buffer = (Buffer) byteBuffer;
buffer.rewind();
byte[] arr = new byte[byteBuffer.capacity()];
byteBuffer.get(arr);
Connection c =... | [
"@",
"Override",
"public",
"Blob",
"convert",
"(",
"INDArray",
"toConvert",
")",
"throws",
"SQLException",
"{",
"ByteBuffer",
"byteBuffer",
"=",
"BinarySerde",
".",
"toByteBuffer",
"(",
"toConvert",
")",
";",
"Buffer",
"buffer",
"=",
"(",
"Buffer",
")",
"byteB... | Convert an ndarray to a blob
@param toConvert the ndarray to convert
@return the converted ndarray | [
"Convert",
"an",
"ndarray",
"to",
"a",
"blob"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java#L85-L96 |
128,242 | deeplearning4j/deeplearning4j | nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java | BaseLoader.load | @Override
public INDArray load(Blob blob) throws SQLException {
if (blob == null)
return null;
try(InputStream is = blob.getBinaryStream()) {
ByteBuffer direct = ByteBuffer.allocateDirect((int) blob.length());
ReadableByteChannel readableByteChannel = Channels.new... | java | @Override
public INDArray load(Blob blob) throws SQLException {
if (blob == null)
return null;
try(InputStream is = blob.getBinaryStream()) {
ByteBuffer direct = ByteBuffer.allocateDirect((int) blob.length());
ReadableByteChannel readableByteChannel = Channels.new... | [
"@",
"Override",
"public",
"INDArray",
"load",
"(",
"Blob",
"blob",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"blob",
"==",
"null",
")",
"return",
"null",
";",
"try",
"(",
"InputStream",
"is",
"=",
"blob",
".",
"getBinaryStream",
"(",
")",
")",
"{... | Load an ndarray from a blob
@param blob the blob to load from
@return the loaded ndarray | [
"Load",
"an",
"ndarray",
"from",
"a",
"blob"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java#L104-L120 |
128,243 | deeplearning4j/deeplearning4j | nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java | BaseLoader.save | @Override
public void save(INDArray save, String id) throws SQLException, IOException {
doSave(save, id);
} | java | @Override
public void save(INDArray save, String id) throws SQLException, IOException {
doSave(save, id);
} | [
"@",
"Override",
"public",
"void",
"save",
"(",
"INDArray",
"save",
",",
"String",
"id",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"doSave",
"(",
"save",
",",
"id",
")",
";",
"}"
] | Save the ndarray
@param save the ndarray to save | [
"Save",
"the",
"ndarray"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java#L127-L131 |
128,244 | deeplearning4j/deeplearning4j | nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java | BaseLoader.loadForID | @Override
public Blob loadForID(String id) throws SQLException {
Connection c = dataSource.getConnection();
PreparedStatement preparedStatement = c.prepareStatement(loadStatement());
preparedStatement.setString(1, id);
ResultSet r = preparedStatement.executeQuery();
if (r.was... | java | @Override
public Blob loadForID(String id) throws SQLException {
Connection c = dataSource.getConnection();
PreparedStatement preparedStatement = c.prepareStatement(loadStatement());
preparedStatement.setString(1, id);
ResultSet r = preparedStatement.executeQuery();
if (r.was... | [
"@",
"Override",
"public",
"Blob",
"loadForID",
"(",
"String",
"id",
")",
"throws",
"SQLException",
"{",
"Connection",
"c",
"=",
"dataSource",
".",
"getConnection",
"(",
")",
";",
"PreparedStatement",
"preparedStatement",
"=",
"c",
".",
"prepareStatement",
"(",
... | Load an ndarray blob given an id
@param id the id to load
@return the blob | [
"Load",
"an",
"ndarray",
"blob",
"given",
"an",
"id"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java#L157-L171 |
128,245 | deeplearning4j/deeplearning4j | nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java | BaseLoader.delete | @Override
public void delete(String id) throws SQLException {
Connection c = dataSource.getConnection();
PreparedStatement p = c.prepareStatement(deleteStatement());
p.setString(1, id);
p.execute();
} | java | @Override
public void delete(String id) throws SQLException {
Connection c = dataSource.getConnection();
PreparedStatement p = c.prepareStatement(deleteStatement());
p.setString(1, id);
p.execute();
} | [
"@",
"Override",
"public",
"void",
"delete",
"(",
"String",
"id",
")",
"throws",
"SQLException",
"{",
"Connection",
"c",
"=",
"dataSource",
".",
"getConnection",
"(",
")",
";",
"PreparedStatement",
"p",
"=",
"c",
".",
"prepareStatement",
"(",
"deleteStatement"... | Delete the given ndarray
@param id the id of the ndarray to delete | [
"Delete",
"the",
"given",
"ndarray"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java#L183-L191 |
128,246 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/embeddings/KerasEmbedding.java | KerasEmbedding.getInputDimFromConfig | private int getInputDimFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if (!innerConfig.containsKey(conf.getLAYER_FIELD_INPUT_DIM()))
throw new InvalidK... | java | private int getInputDimFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if (!innerConfig.containsKey(conf.getLAYER_FIELD_INPUT_DIM()))
throw new InvalidK... | [
"private",
"int",
"getInputDimFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"innerConfig",
"=",
"KerasLayerUtils",
".",
"getInnerLayerCon... | Get Keras input dimension from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return input dim as int | [
"Get",
"Keras",
"input",
"dimension",
"from",
"Keras",
"layer",
"configuration",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/embeddings/KerasEmbedding.java#L229-L235 |
128,247 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/messages/requests/SkipGramRequestMessage.java | SkipGramRequestMessage.processMessage | @Override
@SuppressWarnings("unchecked")
public void processMessage() {
/**
* This method in reality just delegates training to specific TrainingDriver, based on message opType.
* In this case - SkipGram training
*/
//log.info("sI_{} starts SkipGram round...", transpor... | java | @Override
@SuppressWarnings("unchecked")
public void processMessage() {
/**
* This method in reality just delegates training to specific TrainingDriver, based on message opType.
* In this case - SkipGram training
*/
//log.info("sI_{} starts SkipGram round...", transpor... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"processMessage",
"(",
")",
"{",
"/**\n * This method in reality just delegates training to specific TrainingDriver, based on message opType.\n * In this case - SkipGram training\n ... | This method does actual training for SkipGram algorithm | [
"This",
"method",
"does",
"actual",
"training",
"for",
"SkipGram",
"algorithm"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/messages/requests/SkipGramRequestMessage.java#L87-L99 |
128,248 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeParagraphVectors | public static void writeParagraphVectors(ParagraphVectors vectors, File file) {
try (FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream stream = new BufferedOutputStream(fos)) {
writeParagraphVectors(vectors, stream);
} catch (Exception e) {
thro... | java | public static void writeParagraphVectors(ParagraphVectors vectors, File file) {
try (FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream stream = new BufferedOutputStream(fos)) {
writeParagraphVectors(vectors, stream);
} catch (Exception e) {
thro... | [
"public",
"static",
"void",
"writeParagraphVectors",
"(",
"ParagraphVectors",
"vectors",
",",
"File",
"file",
")",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"BufferedOutputStream",
"stream",
"=",
"new",
"B... | This method saves ParagraphVectors model into compressed zip file
@param file | [
"This",
"method",
"saves",
"ParagraphVectors",
"model",
"into",
"compressed",
"zip",
"file"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L406-L413 |
128,249 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeWordVectors | @Deprecated
public static void writeWordVectors(ParagraphVectors vectors, OutputStream stream) {
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stream, StandardCharsets.UTF_8))) {
/*
This method acts similary to w2v csv serialization, except of additional tag ... | java | @Deprecated
public static void writeWordVectors(ParagraphVectors vectors, OutputStream stream) {
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stream, StandardCharsets.UTF_8))) {
/*
This method acts similary to w2v csv serialization, except of additional tag ... | [
"@",
"Deprecated",
"public",
"static",
"void",
"writeWordVectors",
"(",
"ParagraphVectors",
"vectors",
",",
"OutputStream",
"stream",
")",
"{",
"try",
"(",
"BufferedWriter",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"stream",
"... | This method saves paragraph vectors to the given output stream.
@param vectors
@param stream | [
"This",
"method",
"saves",
"paragraph",
"vectors",
"to",
"the",
"given",
"output",
"stream",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1155-L1182 |
128,250 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.fromTableAndVocab | public static WordVectors fromTableAndVocab(WeightLookupTable table, VocabCache vocab) {
WordVectorsImpl vectors = new WordVectorsImpl();
vectors.setLookupTable(table);
vectors.setVocab(vocab);
vectors.setModelUtils(new BasicModelUtils());
return vectors;
} | java | public static WordVectors fromTableAndVocab(WeightLookupTable table, VocabCache vocab) {
WordVectorsImpl vectors = new WordVectorsImpl();
vectors.setLookupTable(table);
vectors.setVocab(vocab);
vectors.setModelUtils(new BasicModelUtils());
return vectors;
} | [
"public",
"static",
"WordVectors",
"fromTableAndVocab",
"(",
"WeightLookupTable",
"table",
",",
"VocabCache",
"vocab",
")",
"{",
"WordVectorsImpl",
"vectors",
"=",
"new",
"WordVectorsImpl",
"(",
")",
";",
"vectors",
".",
"setLookupTable",
"(",
"table",
")",
";",
... | Load word vectors for the given vocab and table
@param table the weights to use
@param vocab the vocab to use
@return wordvectors based on the given parameters | [
"Load",
"word",
"vectors",
"for",
"the",
"given",
"vocab",
"and",
"table"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1568-L1574 |
128,251 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.fromPair | public static Word2Vec fromPair(Pair<InMemoryLookupTable, VocabCache> pair) {
Word2Vec vectors = new Word2Vec();
vectors.setLookupTable(pair.getFirst());
vectors.setVocab(pair.getSecond());
vectors.setModelUtils(new BasicModelUtils());
return vectors;
} | java | public static Word2Vec fromPair(Pair<InMemoryLookupTable, VocabCache> pair) {
Word2Vec vectors = new Word2Vec();
vectors.setLookupTable(pair.getFirst());
vectors.setVocab(pair.getSecond());
vectors.setModelUtils(new BasicModelUtils());
return vectors;
} | [
"public",
"static",
"Word2Vec",
"fromPair",
"(",
"Pair",
"<",
"InMemoryLookupTable",
",",
"VocabCache",
">",
"pair",
")",
"{",
"Word2Vec",
"vectors",
"=",
"new",
"Word2Vec",
"(",
")",
";",
"vectors",
".",
"setLookupTable",
"(",
"pair",
".",
"getFirst",
"(",
... | Load word vectors from the given pair
@param pair the given pair
@return a read only word vectors impl based on the given lookup table and vocab | [
"Load",
"word",
"vectors",
"from",
"the",
"given",
"pair"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1582-L1588 |
128,252 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeTsneFormat | public static void writeTsneFormat(Glove vec, INDArray tsne, File csv) throws Exception {
try (BufferedWriter write = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(csv), StandardCharsets.UTF_8))) {
int words = 0;
InMemoryLookupCache l = (InMemoryLookupCache) vec.vocab();... | java | public static void writeTsneFormat(Glove vec, INDArray tsne, File csv) throws Exception {
try (BufferedWriter write = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(csv), StandardCharsets.UTF_8))) {
int words = 0;
InMemoryLookupCache l = (InMemoryLookupCache) vec.vocab();... | [
"public",
"static",
"void",
"writeTsneFormat",
"(",
"Glove",
"vec",
",",
"INDArray",
"tsne",
",",
"File",
"csv",
")",
"throws",
"Exception",
"{",
"try",
"(",
"BufferedWriter",
"write",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"new",... | Write the tsne format
@param vec the word vectors to use for labeling
@param tsne the tsne array to write
@param csv the file to use
@throws Exception | [
"Write",
"the",
"tsne",
"format"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1819-L1846 |
128,253 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/transferlearning/TransferLearningHelper.java | TransferLearningHelper.outputFromFeaturized | public INDArray outputFromFeaturized(INDArray input) {
if (isGraph) {
if (unFrozenSubsetGraph.getNumOutputArrays() > 1) {
throw new IllegalArgumentException(
"Graph has more than one output. Expecting an input array with outputFromFeaturized method cal... | java | public INDArray outputFromFeaturized(INDArray input) {
if (isGraph) {
if (unFrozenSubsetGraph.getNumOutputArrays() > 1) {
throw new IllegalArgumentException(
"Graph has more than one output. Expecting an input array with outputFromFeaturized method cal... | [
"public",
"INDArray",
"outputFromFeaturized",
"(",
"INDArray",
"input",
")",
"{",
"if",
"(",
"isGraph",
")",
"{",
"if",
"(",
"unFrozenSubsetGraph",
".",
"getNumOutputArrays",
"(",
")",
">",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Gra... | Use to get the output from a featurized input
@param input featurized data
@return output | [
"Use",
"to",
"get",
"the",
"output",
"from",
"a",
"featurized",
"input"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/transferlearning/TransferLearningHelper.java#L158-L168 |
128,254 | deeplearning4j/deeplearning4j | arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java | ScoreUtil.getEvaluation | public static Evaluation getEvaluation(ComputationGraph model, MultiDataSetIterator testData) {
if (model.getNumOutputArrays() != 1)
throw new IllegalStateException("GraphSetSetAccuracyScoreFunction cannot be "
+ "applied to ComputationGraphs with more than one output. Nu... | java | public static Evaluation getEvaluation(ComputationGraph model, MultiDataSetIterator testData) {
if (model.getNumOutputArrays() != 1)
throw new IllegalStateException("GraphSetSetAccuracyScoreFunction cannot be "
+ "applied to ComputationGraphs with more than one output. Nu... | [
"public",
"static",
"Evaluation",
"getEvaluation",
"(",
"ComputationGraph",
"model",
",",
"MultiDataSetIterator",
"testData",
")",
"{",
"if",
"(",
"model",
".",
"getNumOutputArrays",
"(",
")",
"!=",
"1",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"GraphS... | Get the evaluation
for the given model and test dataset
@param model the model to get the evaluation from
@param testData the test data to do the evaluation on
@return the evaluation object with accumulated statistics
for the current test data | [
"Get",
"the",
"evaluation",
"for",
"the",
"given",
"model",
"and",
"test",
"dataset"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java#L105-L112 |
128,255 | deeplearning4j/deeplearning4j | arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java | ScoreUtil.score | public static double score(ComputationGraph model, MultiDataSetIterator testData, boolean average) {
//TODO: do this properly taking into account division by N, L1/L2 etc
double sumScore = 0.0;
int totalExamples = 0;
while (testData.hasNext()) {
MultiDataSet ds = testData.nex... | java | public static double score(ComputationGraph model, MultiDataSetIterator testData, boolean average) {
//TODO: do this properly taking into account division by N, L1/L2 etc
double sumScore = 0.0;
int totalExamples = 0;
while (testData.hasNext()) {
MultiDataSet ds = testData.nex... | [
"public",
"static",
"double",
"score",
"(",
"ComputationGraph",
"model",
",",
"MultiDataSetIterator",
"testData",
",",
"boolean",
"average",
")",
"{",
"//TODO: do this properly taking into account division by N, L1/L2 etc",
"double",
"sumScore",
"=",
"0.0",
";",
"int",
"t... | Score based on the loss function
@param model the model to score with
@param testData the test data to score
@param average whether to average the score
for the whole batch or not
@return the score for the given test set | [
"Score",
"based",
"on",
"the",
"loss",
"function"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java#L142-L156 |
128,256 | deeplearning4j/deeplearning4j | arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java | ScoreUtil.score | public static double score(MultiLayerNetwork model, DataSetIterator testData, boolean average) {
//TODO: do this properly taking into account division by N, L1/L2 etc
double sumScore = 0.0;
int totalExamples = 0;
while (testData.hasNext()) {
DataSet ds = testData.next();
... | java | public static double score(MultiLayerNetwork model, DataSetIterator testData, boolean average) {
//TODO: do this properly taking into account division by N, L1/L2 etc
double sumScore = 0.0;
int totalExamples = 0;
while (testData.hasNext()) {
DataSet ds = testData.next();
... | [
"public",
"static",
"double",
"score",
"(",
"MultiLayerNetwork",
"model",
",",
"DataSetIterator",
"testData",
",",
"boolean",
"average",
")",
"{",
"//TODO: do this properly taking into account division by N, L1/L2 etc",
"double",
"sumScore",
"=",
"0.0",
";",
"int",
"total... | Score the given test data
with the given multi layer network
@param model model to use
@param testData the test data to test with
@param average whether to average the score or not
@return the score for the given test data given the model | [
"Score",
"the",
"given",
"test",
"data",
"with",
"the",
"given",
"multi",
"layer",
"network"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java#L266-L281 |
128,257 | deeplearning4j/deeplearning4j | arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java | ScoreUtil.score | public static double score(MultiLayerNetwork model, DataSetIterator testSet, RegressionValue regressionValue) {
RegressionEvaluation eval = model.evaluateRegression(testSet);
return getScoreFromRegressionEval(eval, regressionValue);
} | java | public static double score(MultiLayerNetwork model, DataSetIterator testSet, RegressionValue regressionValue) {
RegressionEvaluation eval = model.evaluateRegression(testSet);
return getScoreFromRegressionEval(eval, regressionValue);
} | [
"public",
"static",
"double",
"score",
"(",
"MultiLayerNetwork",
"model",
",",
"DataSetIterator",
"testSet",
",",
"RegressionValue",
"regressionValue",
")",
"{",
"RegressionEvaluation",
"eval",
"=",
"model",
".",
"evaluateRegression",
"(",
"testSet",
")",
";",
"retu... | Score the given multi layer network
@param model the model to score
@param testSet the test set
@param regressionValue the regression function to use
@return the score from the given test set | [
"Score",
"the",
"given",
"multi",
"layer",
"network"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-deeplearning4j/src/main/java/org/deeplearning4j/arbiter/scoring/util/ScoreUtil.java#L291-L294 |
128,258 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/util/NetworkOrganizer.java | NetworkOrganizer.getMatchingAddress | public String getMatchingAddress() {
if (informationCollection.size() > 1)
this.informationCollection = buildLocalInformation();
List<String> list = getSubset(1);
if (list.size() < 1)
throw new ND4JIllegalStateException(
"Unable to find networ... | java | public String getMatchingAddress() {
if (informationCollection.size() > 1)
this.informationCollection = buildLocalInformation();
List<String> list = getSubset(1);
if (list.size() < 1)
throw new ND4JIllegalStateException(
"Unable to find networ... | [
"public",
"String",
"getMatchingAddress",
"(",
")",
"{",
"if",
"(",
"informationCollection",
".",
"size",
"(",
")",
">",
"1",
")",
"this",
".",
"informationCollection",
"=",
"buildLocalInformation",
"(",
")",
";",
"List",
"<",
"String",
">",
"list",
"=",
"... | This method returns local IP address that matches given network mask.
To be used with single-argument constructor only.
@return | [
"This",
"method",
"returns",
"local",
"IP",
"address",
"that",
"matches",
"given",
"network",
"mask",
".",
"To",
"be",
"used",
"with",
"single",
"-",
"argument",
"constructor",
"only",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/util/NetworkOrganizer.java#L99-L112 |
128,259 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/util/NetworkOrganizer.java | NetworkOrganizer.getSubset | public List<String> getSubset(int numShards, Collection<String> primary) {
/**
* If netmask in unset, we'll use manual
*/
if (networkMask == null)
return getIntersections(numShards, primary);
List<String> addresses = new ArrayList<>();
SubnetUtils utils = ... | java | public List<String> getSubset(int numShards, Collection<String> primary) {
/**
* If netmask in unset, we'll use manual
*/
if (networkMask == null)
return getIntersections(numShards, primary);
List<String> addresses = new ArrayList<>();
SubnetUtils utils = ... | [
"public",
"List",
"<",
"String",
">",
"getSubset",
"(",
"int",
"numShards",
",",
"Collection",
"<",
"String",
">",
"primary",
")",
"{",
"/**\n * If netmask in unset, we'll use manual\n */",
"if",
"(",
"networkMask",
"==",
"null",
")",
"return",
"getI... | This method returns specified number of IP addresses from original list of addresses, that are NOT listen in primary collection
@param numShards
@param primary Collection of IP addresses that shouldn't be in result
@return | [
"This",
"method",
"returns",
"specified",
"number",
"of",
"IP",
"addresses",
"from",
"original",
"list",
"of",
"addresses",
"that",
"are",
"NOT",
"listen",
"in",
"primary",
"collection"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/util/NetworkOrganizer.java#L132-L164 |
128,260 | deeplearning4j/deeplearning4j | arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/runner/BaseOptimizationRunner.java | BaseOptimizationRunner.processReturnedTask | private void processReturnedTask(Future<OptimizationResult> future) {
long currentTime = System.currentTimeMillis();
OptimizationResult result;
try {
result = future.get(100, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
throw new RuntimeException("Un... | java | private void processReturnedTask(Future<OptimizationResult> future) {
long currentTime = System.currentTimeMillis();
OptimizationResult result;
try {
result = future.get(100, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
throw new RuntimeException("Un... | [
"private",
"void",
"processReturnedTask",
"(",
"Future",
"<",
"OptimizationResult",
">",
"future",
")",
"{",
"long",
"currentTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"OptimizationResult",
"result",
";",
"try",
"{",
"result",
"=",
"future",
... | Process returned task (either completed or failed | [
"Process",
"returned",
"task",
"(",
"either",
"completed",
"or",
"failed"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/runner/BaseOptimizationRunner.java#L201-L262 |
128,261 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Bernoulli.java | Bernoulli.set | protected void set(final int n, final Rational value) {
final int nindx = n / 2;
if (nindx < a.size()) {
a.set(nindx, value);
} else {
while (a.size() < nindx) {
a.add(Rational.ZERO);
}
a.add(value);
}
} | java | protected void set(final int n, final Rational value) {
final int nindx = n / 2;
if (nindx < a.size()) {
a.set(nindx, value);
} else {
while (a.size() < nindx) {
a.add(Rational.ZERO);
}
a.add(value);
}
} | [
"protected",
"void",
"set",
"(",
"final",
"int",
"n",
",",
"final",
"Rational",
"value",
")",
"{",
"final",
"int",
"nindx",
"=",
"n",
"/",
"2",
";",
"if",
"(",
"nindx",
"<",
"a",
".",
"size",
"(",
")",
")",
"{",
"a",
".",
"set",
"(",
"nindx",
... | Set a coefficient in the internal table.
@param n the zero-based index of the coefficient. n=0 for the constant term.
@param value the new value of the coefficient. | [
"Set",
"a",
"coefficient",
"in",
"the",
"internal",
"table",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Bernoulli.java#L51-L61 |
128,262 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Bernoulli.java | Bernoulli.at | public Rational at(int n) {
if (n == 1) {
return (new Rational(-1, 2));
} else if (n % 2 != 0) {
return Rational.ZERO;
} else {
final int nindx = n / 2;
if (a.size() <= nindx) {
for (int i = 2 * a.size(); i <= n; i += 2) {
... | java | public Rational at(int n) {
if (n == 1) {
return (new Rational(-1, 2));
} else if (n % 2 != 0) {
return Rational.ZERO;
} else {
final int nindx = n / 2;
if (a.size() <= nindx) {
for (int i = 2 * a.size(); i <= n; i += 2) {
... | [
"public",
"Rational",
"at",
"(",
"int",
"n",
")",
"{",
"if",
"(",
"n",
"==",
"1",
")",
"{",
"return",
"(",
"new",
"Rational",
"(",
"-",
"1",
",",
"2",
")",
")",
";",
"}",
"else",
"if",
"(",
"n",
"%",
"2",
"!=",
"0",
")",
"{",
"return",
"R... | The Bernoulli number at the index provided.
@param n the index, non-negative.
@return the B_0=1 for n=0, B_1=-1/2 for n=1, B_2=1/6 for n=2 etc | [
"The",
"Bernoulli",
"number",
"at",
"the",
"index",
"provided",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Bernoulli.java#L69-L83 |
128,263 | deeplearning4j/deeplearning4j | datavec/datavec-spark-inference-parent/datavec-spark-inference-model/src/main/java/org/datavec/spark/transform/model/SequenceBatchCSVRecord.java | SequenceBatchCSVRecord.fromWritables | public static SequenceBatchCSVRecord fromWritables(List<List<List<Writable>>> input) {
SequenceBatchCSVRecord ret = new SequenceBatchCSVRecord();
for(int i = 0; i < input.size(); i++) {
ret.add(Arrays.asList(BatchCSVRecord.fromWritables(input.get(i))));
}
return ret;
} | java | public static SequenceBatchCSVRecord fromWritables(List<List<List<Writable>>> input) {
SequenceBatchCSVRecord ret = new SequenceBatchCSVRecord();
for(int i = 0; i < input.size(); i++) {
ret.add(Arrays.asList(BatchCSVRecord.fromWritables(input.get(i))));
}
return ret;
} | [
"public",
"static",
"SequenceBatchCSVRecord",
"fromWritables",
"(",
"List",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"input",
")",
"{",
"SequenceBatchCSVRecord",
"ret",
"=",
"new",
"SequenceBatchCSVRecord",
"(",
")",
";",
"for",
"(",
"int",
... | Convert a writables time series to a sequence batch
@param input
@return | [
"Convert",
"a",
"writables",
"time",
"series",
"to",
"a",
"sequence",
"batch"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark-inference-parent/datavec-spark-inference-model/src/main/java/org/datavec/spark/transform/model/SequenceBatchCSVRecord.java#L81-L88 |
128,264 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/Java2DNativeImageLoader.java | Java2DNativeImageLoader.asBufferedImage | public BufferedImage asBufferedImage(INDArray array, int dataType) {
return converter2.convert(asFrame(array, dataType));
} | java | public BufferedImage asBufferedImage(INDArray array, int dataType) {
return converter2.convert(asFrame(array, dataType));
} | [
"public",
"BufferedImage",
"asBufferedImage",
"(",
"INDArray",
"array",
",",
"int",
"dataType",
")",
"{",
"return",
"converter2",
".",
"convert",
"(",
"asFrame",
"(",
"array",
",",
"dataType",
")",
")",
";",
"}"
] | Converts an INDArray to a BufferedImage. Only intended for images with rank 3.
@param array to convert
@param dataType from JavaCV (DEPTH_FLOAT, DEPTH_UBYTE, etc), or -1 to use same type as the INDArray
@return data copied to a Frame | [
"Converts",
"an",
"INDArray",
"to",
"a",
"BufferedImage",
".",
"Only",
"intended",
"for",
"images",
"with",
"rank",
"3",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/Java2DNativeImageLoader.java#L117-L119 |
128,265 | deeplearning4j/deeplearning4j | arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/generator/genetic/crossover/utils/CrossoverPointsGenerator.java | CrossoverPointsGenerator.getCrossoverPoints | public Deque<Integer> getCrossoverPoints() {
Collections.shuffle(parameterIndexes);
List<Integer> crossoverPointLists =
parameterIndexes.subList(0, rng.nextInt(maxCrossovers - minCrossovers) + minCrossovers);
Collections.sort(crossoverPointLists);
Deque<Integer> c... | java | public Deque<Integer> getCrossoverPoints() {
Collections.shuffle(parameterIndexes);
List<Integer> crossoverPointLists =
parameterIndexes.subList(0, rng.nextInt(maxCrossovers - minCrossovers) + minCrossovers);
Collections.sort(crossoverPointLists);
Deque<Integer> c... | [
"public",
"Deque",
"<",
"Integer",
">",
"getCrossoverPoints",
"(",
")",
"{",
"Collections",
".",
"shuffle",
"(",
"parameterIndexes",
")",
";",
"List",
"<",
"Integer",
">",
"crossoverPointLists",
"=",
"parameterIndexes",
".",
"subList",
"(",
"0",
",",
"rng",
... | Generate a list of crossover points.
@return An ordered list of crossover point indexes and with Integer.MAX_VALUE as the last element | [
"Generate",
"a",
"list",
"of",
"crossover",
"points",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/generator/genetic/crossover/utils/CrossoverPointsGenerator.java#L55-L64 |
128,266 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-nlp/src/main/java/org/datavec/nlp/transforms/TokenizerBagOfWordsTermSequenceIndexTransform.java | TokenizerBagOfWordsTermSequenceIndexTransform.tfidfWord | public double tfidfWord(String word, long wordCount, long documentLength) {
double tf = tfForWord(wordCount, documentLength);
double idf = idfForWord(word);
return MathUtils.tfidf(tf, idf);
} | java | public double tfidfWord(String word, long wordCount, long documentLength) {
double tf = tfForWord(wordCount, documentLength);
double idf = idfForWord(word);
return MathUtils.tfidf(tf, idf);
} | [
"public",
"double",
"tfidfWord",
"(",
"String",
"word",
",",
"long",
"wordCount",
",",
"long",
"documentLength",
")",
"{",
"double",
"tf",
"=",
"tfForWord",
"(",
"wordCount",
",",
"documentLength",
")",
";",
"double",
"idf",
"=",
"idfForWord",
"(",
"word",
... | Calculate the tifdf for a word
given the word, word count, and document length
@param word the word to calculate
@param wordCount the word frequency
@param documentLength the number of words in the document
@return the tfidf weight for a given word | [
"Calculate",
"the",
"tifdf",
"for",
"a",
"word",
"given",
"the",
"word",
"word",
"count",
"and",
"document",
"length"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-nlp/src/main/java/org/datavec/nlp/transforms/TokenizerBagOfWordsTermSequenceIndexTransform.java#L192-L196 |
128,267 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/KerasLayer.java | KerasLayer.registerCustomLayer | public static void registerCustomLayer(String layerName, Class<? extends KerasLayer> configClass) {
customLayers.put(layerName, configClass);
} | java | public static void registerCustomLayer(String layerName, Class<? extends KerasLayer> configClass) {
customLayers.put(layerName, configClass);
} | [
"public",
"static",
"void",
"registerCustomLayer",
"(",
"String",
"layerName",
",",
"Class",
"<",
"?",
"extends",
"KerasLayer",
">",
"configClass",
")",
"{",
"customLayers",
".",
"put",
"(",
"layerName",
",",
"configClass",
")",
";",
"}"
] | Register a custom layer
@param layerName name of custom layer class
@param configClass class of custom layer | [
"Register",
"a",
"custom",
"layer"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/KerasLayer.java#L171-L173 |
128,268 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/KerasLayer.java | KerasLayer.copyWeightsToLayer | public void copyWeightsToLayer(org.deeplearning4j.nn.api.Layer layer) throws InvalidKerasConfigurationException {
if (this.getNumParams() > 0) {
String dl4jLayerName = layer.conf().getLayer().getLayerName();
String kerasLayerName = this.getLayerName();
String msg = "Error whe... | java | public void copyWeightsToLayer(org.deeplearning4j.nn.api.Layer layer) throws InvalidKerasConfigurationException {
if (this.getNumParams() > 0) {
String dl4jLayerName = layer.conf().getLayer().getLayerName();
String kerasLayerName = this.getLayerName();
String msg = "Error whe... | [
"public",
"void",
"copyWeightsToLayer",
"(",
"org",
".",
"deeplearning4j",
".",
"nn",
".",
"api",
".",
"Layer",
"layer",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"if",
"(",
"this",
".",
"getNumParams",
"(",
")",
">",
"0",
")",
"{",
"String",... | Copy Keras layer weights to DL4J Layer.
@param layer DL4J layer
@throws InvalidKerasConfigurationException Invalid Keras configuration | [
"Copy",
"Keras",
"layer",
"weights",
"to",
"DL4J",
"Layer",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/KerasLayer.java#L294-L338 |
128,269 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/KerasLayer.java | KerasLayer.getNInFromConfig | protected long getNInFromConfig(Map<String, ? extends KerasLayer> previousLayers) throws UnsupportedKerasConfigurationException {
int size = previousLayers.size();
int count = 0;
long nIn;
String inboundLayerName = inboundLayerNames.get(0);
while (count <= size) {
if ... | java | protected long getNInFromConfig(Map<String, ? extends KerasLayer> previousLayers) throws UnsupportedKerasConfigurationException {
int size = previousLayers.size();
int count = 0;
long nIn;
String inboundLayerName = inboundLayerNames.get(0);
while (count <= size) {
if ... | [
"protected",
"long",
"getNInFromConfig",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"KerasLayer",
">",
"previousLayers",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"int",
"size",
"=",
"previousLayers",
".",
"size",
"(",
")",
";",
"int",
"... | Some DL4J layers need explicit specification of number of inputs, which Keras does infer.
This method searches through previous layers until a FeedForwardLayer is found. These layers
have nOut values that subsequently correspond to the nIn value of this layer.
@param previousLayers
@return
@throws UnsupportedKerasConf... | [
"Some",
"DL4J",
"layers",
"need",
"explicit",
"specification",
"of",
"number",
"of",
"inputs",
"which",
"Keras",
"does",
"infer",
".",
"This",
"method",
"searches",
"through",
"previous",
"layers",
"until",
"a",
"FeedForwardLayer",
"is",
"found",
".",
"These",
... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/KerasLayer.java#L398-L420 |
128,270 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.layerNorm | public SDVariable layerNorm(SDVariable input, SDVariable gain, int... dimensions) {
return layerNorm((String)null, input, gain, dimensions);
} | java | public SDVariable layerNorm(SDVariable input, SDVariable gain, int... dimensions) {
return layerNorm((String)null, input, gain, dimensions);
} | [
"public",
"SDVariable",
"layerNorm",
"(",
"SDVariable",
"input",
",",
"SDVariable",
"gain",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"layerNorm",
"(",
"(",
"String",
")",
"null",
",",
"input",
",",
"gain",
",",
"dimensions",
")",
";",
"}"
] | Apply Layer Normalization without bias
y = gain * standardize(x)
@return Output variable | [
"Apply",
"Layer",
"Normalization",
"without",
"bias"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L731-L733 |
128,271 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/records/writer/impl/misc/SVMLightRecordWriter.java | SVMLightRecordWriter.setConf | @Override
public void setConf(Configuration conf) {
super.setConf(conf);
featureFirstColumn = conf.getInt(FEATURE_FIRST_COLUMN, 0);
hasLabel = conf.getBoolean(HAS_LABELS, true);
multilabel = conf.getBoolean(MULTILABEL, false);
labelFirstColumn = conf.getInt(LABEL_FIRST_COLUMN... | java | @Override
public void setConf(Configuration conf) {
super.setConf(conf);
featureFirstColumn = conf.getInt(FEATURE_FIRST_COLUMN, 0);
hasLabel = conf.getBoolean(HAS_LABELS, true);
multilabel = conf.getBoolean(MULTILABEL, false);
labelFirstColumn = conf.getInt(LABEL_FIRST_COLUMN... | [
"@",
"Override",
"public",
"void",
"setConf",
"(",
"Configuration",
"conf",
")",
"{",
"super",
".",
"setConf",
"(",
"conf",
")",
";",
"featureFirstColumn",
"=",
"conf",
".",
"getInt",
"(",
"FEATURE_FIRST_COLUMN",
",",
"0",
")",
";",
"hasLabel",
"=",
"conf"... | Set DataVec configuration
@param conf | [
"Set",
"DataVec",
"configuration"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/records/writer/impl/misc/SVMLightRecordWriter.java#L96-L107 |
128,272 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.updaterDivideByMinibatch | @Override
public boolean updaterDivideByMinibatch(String paramName) {
int idx = paramName.indexOf('_');
int layerIdx = Integer.parseInt(paramName.substring(0, idx));
String subName = paramName.substring(idx+1);
return getLayer(layerIdx).updaterDivideByMinibatch(subName);
} | java | @Override
public boolean updaterDivideByMinibatch(String paramName) {
int idx = paramName.indexOf('_');
int layerIdx = Integer.parseInt(paramName.substring(0, idx));
String subName = paramName.substring(idx+1);
return getLayer(layerIdx).updaterDivideByMinibatch(subName);
} | [
"@",
"Override",
"public",
"boolean",
"updaterDivideByMinibatch",
"(",
"String",
"paramName",
")",
"{",
"int",
"idx",
"=",
"paramName",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"int",
"layerIdx",
"=",
"Integer",
".",
"parseInt",
"(",
"paramName",
".",
"sub... | Intended for internal use | [
"Intended",
"for",
"internal",
"use"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L520-L526 |
128,273 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.activateSelectedLayers | public INDArray activateSelectedLayers(int from, int to, INDArray input) {
if (input == null)
throw new IllegalStateException("Unable to perform activation; no input found");
if (from < 0 || from >= layers.length || from >= to)
throw new IllegalStateException("Unable to perform a... | java | public INDArray activateSelectedLayers(int from, int to, INDArray input) {
if (input == null)
throw new IllegalStateException("Unable to perform activation; no input found");
if (from < 0 || from >= layers.length || from >= to)
throw new IllegalStateException("Unable to perform a... | [
"public",
"INDArray",
"activateSelectedLayers",
"(",
"int",
"from",
",",
"int",
"to",
",",
"INDArray",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Unable to perform activation; no input found\"",
")",
... | Calculate activation for few layers at once. Suitable for autoencoder partial activation.
In example: in 10-layer deep autoencoder, layers 0 - 4 inclusive are used for encoding part, and layers 5-9 inclusive are used for decoding part.
@param from first layer to be activated, inclusive
@param to last layer to be acti... | [
"Calculate",
"activation",
"for",
"few",
"layers",
"at",
"once",
".",
"Suitable",
"for",
"autoencoder",
"partial",
"activation",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L819-L839 |
128,274 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.numParams | @Override
public long numParams(boolean backwards) {
int length = 0;
for (int i = 0; i < layers.length; i++)
length += layers[i].numParams(backwards);
return length;
} | java | @Override
public long numParams(boolean backwards) {
int length = 0;
for (int i = 0; i < layers.length; i++)
length += layers[i].numParams(backwards);
return length;
} | [
"@",
"Override",
"public",
"long",
"numParams",
"(",
"boolean",
"backwards",
")",
"{",
"int",
"length",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"layers",
".",
"length",
";",
"i",
"++",
")",
"length",
"+=",
"layers",
"[",
"... | Returns the number of parameters in the network
@param backwards If true: exclude any parameters uned only in unsupervised layerwise training (such as the decoder
parameters in an autoencoder)
@return The number of parameters | [
"Returns",
"the",
"number",
"of",
"parameters",
"in",
"the",
"network"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L1550-L1557 |
128,275 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.f1Score | @Override
public double f1Score(org.nd4j.linalg.dataset.api.DataSet data) {
return f1Score(data.getFeatures(), data.getLabels());
} | java | @Override
public double f1Score(org.nd4j.linalg.dataset.api.DataSet data) {
return f1Score(data.getFeatures(), data.getLabels());
} | [
"@",
"Override",
"public",
"double",
"f1Score",
"(",
"org",
".",
"nd4j",
".",
"linalg",
".",
"dataset",
".",
"api",
".",
"DataSet",
"data",
")",
"{",
"return",
"f1Score",
"(",
"data",
".",
"getFeatures",
"(",
")",
",",
"data",
".",
"getLabels",
"(",
... | Sets the input and labels and returns the F1 score for the prediction with respect to the true labels
@param data the data to score
@return the score for the given input,label pairs | [
"Sets",
"the",
"input",
"and",
"labels",
"and",
"returns",
"the",
"F1",
"score",
"for",
"the",
"prediction",
"with",
"respect",
"to",
"the",
"true",
"labels"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L1565-L1568 |
128,276 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.clear | public void clear() {
for (Layer layer : layers)
layer.clear();
input = null;
labels = null;
solver = null;
} | java | public void clear() {
for (Layer layer : layers)
layer.clear();
input = null;
labels = null;
solver = null;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"for",
"(",
"Layer",
"layer",
":",
"layers",
")",
"layer",
".",
"clear",
"(",
")",
";",
"input",
"=",
"null",
";",
"labels",
"=",
"null",
";",
"solver",
"=",
"null",
";",
"}"
] | Clear the inputs. Clears optimizer state. | [
"Clear",
"the",
"inputs",
".",
"Clears",
"optimizer",
"state",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L2710-L2717 |
128,277 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.setInput | public void setInput(INDArray input) {
this.input = input;
if (this.layers == null) {
init();
}
if (input != null) {
if (input.length() == 0)
throw new IllegalArgumentException(
"Invalid input: length 0 (shape: " + Arrays.to... | java | public void setInput(INDArray input) {
this.input = input;
if (this.layers == null) {
init();
}
if (input != null) {
if (input.length() == 0)
throw new IllegalArgumentException(
"Invalid input: length 0 (shape: " + Arrays.to... | [
"public",
"void",
"setInput",
"(",
"INDArray",
"input",
")",
"{",
"this",
".",
"input",
"=",
"input",
";",
"if",
"(",
"this",
".",
"layers",
"==",
"null",
")",
"{",
"init",
"(",
")",
";",
"}",
"if",
"(",
"input",
"!=",
"null",
")",
"{",
"if",
"... | Set the input array for the network
@param input Input array to set | [
"Set",
"the",
"input",
"array",
"for",
"the",
"network"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L2732-L2745 |
128,278 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.getOutputLayer | public Layer getOutputLayer() {
Layer ret = getLayers()[getLayers().length - 1];
if (ret instanceof FrozenLayerWithBackprop) {
ret = ((FrozenLayerWithBackprop) ret).getInsideLayer();
}
return ret;
} | java | public Layer getOutputLayer() {
Layer ret = getLayers()[getLayers().length - 1];
if (ret instanceof FrozenLayerWithBackprop) {
ret = ((FrozenLayerWithBackprop) ret).getInsideLayer();
}
return ret;
} | [
"public",
"Layer",
"getOutputLayer",
"(",
")",
"{",
"Layer",
"ret",
"=",
"getLayers",
"(",
")",
"[",
"getLayers",
"(",
")",
".",
"length",
"-",
"1",
"]",
";",
"if",
"(",
"ret",
"instanceof",
"FrozenLayerWithBackprop",
")",
"{",
"ret",
"=",
"(",
"(",
... | Get the output layer - i.e., the last layer in the netwok
@return | [
"Get",
"the",
"output",
"layer",
"-",
"i",
".",
"e",
".",
"the",
"last",
"layer",
"in",
"the",
"netwok"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L2757-L2763 |
128,279 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.evaluateRegression | public <T extends RegressionEvaluation> T evaluateRegression(DataSetIterator iterator) {
return (T)doEvaluation(iterator, new RegressionEvaluation(iterator.totalOutcomes()))[0];
} | java | public <T extends RegressionEvaluation> T evaluateRegression(DataSetIterator iterator) {
return (T)doEvaluation(iterator, new RegressionEvaluation(iterator.totalOutcomes()))[0];
} | [
"public",
"<",
"T",
"extends",
"RegressionEvaluation",
">",
"T",
"evaluateRegression",
"(",
"DataSetIterator",
"iterator",
")",
"{",
"return",
"(",
"T",
")",
"doEvaluation",
"(",
"iterator",
",",
"new",
"RegressionEvaluation",
"(",
"iterator",
".",
"totalOutcomes"... | Evaluate the network for regression performance
@param iterator Data to evaluate on
@return | [
"Evaluate",
"the",
"network",
"for",
"regression",
"performance"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L3243-L3245 |
128,280 | deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java | ArrowSerde.createDims | public static int createDims(FlatBufferBuilder bufferBuilder,INDArray arr) {
int[] tensorDimOffsets = new int[arr.rank()];
int[] nameOffset = new int[arr.rank()];
for(int i = 0; i < tensorDimOffsets.length; i++) {
nameOffset[i] = bufferBuilder.createString("");
tensorDimO... | java | public static int createDims(FlatBufferBuilder bufferBuilder,INDArray arr) {
int[] tensorDimOffsets = new int[arr.rank()];
int[] nameOffset = new int[arr.rank()];
for(int i = 0; i < tensorDimOffsets.length; i++) {
nameOffset[i] = bufferBuilder.createString("");
tensorDimO... | [
"public",
"static",
"int",
"createDims",
"(",
"FlatBufferBuilder",
"bufferBuilder",
",",
"INDArray",
"arr",
")",
"{",
"int",
"[",
"]",
"tensorDimOffsets",
"=",
"new",
"int",
"[",
"arr",
".",
"rank",
"(",
")",
"]",
";",
"int",
"[",
"]",
"nameOffset",
"=",... | Create the dimensions for the flatbuffer builder
@param bufferBuilder the buffer builder to use
@param arr the input array
@return | [
"Create",
"the",
"dimensions",
"for",
"the",
"flatbuffer",
"builder"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java#L139-L148 |
128,281 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/AndroidNativeImageLoader.java | AndroidNativeImageLoader.asBitmap | public Bitmap asBitmap(INDArray array, int dataType) {
return converter2.convert(asFrame(array, dataType));
} | java | public Bitmap asBitmap(INDArray array, int dataType) {
return converter2.convert(asFrame(array, dataType));
} | [
"public",
"Bitmap",
"asBitmap",
"(",
"INDArray",
"array",
",",
"int",
"dataType",
")",
"{",
"return",
"converter2",
".",
"convert",
"(",
"asFrame",
"(",
"array",
",",
"dataType",
")",
")",
";",
"}"
] | Converts an INDArray to a Bitmap. Only intended for images with rank 3.
@param array to convert
@param dataType from JavaCV (DEPTH_FLOAT, DEPTH_UBYTE, etc), or -1 to use same type as the INDArray
@return data copied to a Frame | [
"Converts",
"an",
"INDArray",
"to",
"a",
"Bitmap",
".",
"Only",
"intended",
"for",
"images",
"with",
"rank",
"3",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/AndroidNativeImageLoader.java#L92-L94 |
128,282 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.totalCount | public int totalCount(int outputNum) {
assertIndex(outputNum);
return countTruePositive[outputNum] + countTrueNegative[outputNum] + countFalseNegative[outputNum]
+ countFalsePositive[outputNum];
} | java | public int totalCount(int outputNum) {
assertIndex(outputNum);
return countTruePositive[outputNum] + countTrueNegative[outputNum] + countFalseNegative[outputNum]
+ countFalsePositive[outputNum];
} | [
"public",
"int",
"totalCount",
"(",
"int",
"outputNum",
")",
"{",
"assertIndex",
"(",
"outputNum",
")",
";",
"return",
"countTruePositive",
"[",
"outputNum",
"]",
"+",
"countTrueNegative",
"[",
"outputNum",
"]",
"+",
"countFalseNegative",
"[",
"outputNum",
"]",
... | Get the total number of values for the specified column, accounting for any masking | [
"Get",
"the",
"total",
"number",
"of",
"values",
"for",
"the",
"specified",
"column",
"accounting",
"for",
"any",
"masking"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L300-L304 |
128,283 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.accuracy | public double accuracy(int outputNum) {
assertIndex(outputNum);
return (countTruePositive[outputNum] + countTrueNegative[outputNum]) / (double) totalCount(outputNum);
} | java | public double accuracy(int outputNum) {
assertIndex(outputNum);
return (countTruePositive[outputNum] + countTrueNegative[outputNum]) / (double) totalCount(outputNum);
} | [
"public",
"double",
"accuracy",
"(",
"int",
"outputNum",
")",
"{",
"assertIndex",
"(",
"outputNum",
")",
";",
"return",
"(",
"countTruePositive",
"[",
"outputNum",
"]",
"+",
"countTrueNegative",
"[",
"outputNum",
"]",
")",
"/",
"(",
"double",
")",
"totalCoun... | Get the accuracy for the specified output | [
"Get",
"the",
"accuracy",
"for",
"the",
"specified",
"output"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L353-L356 |
128,284 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.fBeta | public double fBeta(double beta, int outputNum) {
assertIndex(outputNum);
double precision = precision(outputNum);
double recall = recall(outputNum);
return EvaluationUtils.fBeta(beta, precision, recall);
} | java | public double fBeta(double beta, int outputNum) {
assertIndex(outputNum);
double precision = precision(outputNum);
double recall = recall(outputNum);
return EvaluationUtils.fBeta(beta, precision, recall);
} | [
"public",
"double",
"fBeta",
"(",
"double",
"beta",
",",
"int",
"outputNum",
")",
"{",
"assertIndex",
"(",
"outputNum",
")",
";",
"double",
"precision",
"=",
"precision",
"(",
"outputNum",
")",
";",
"double",
"recall",
"=",
"recall",
"(",
"outputNum",
")",... | Calculate the F-beta value for the given output
@param beta Beta value to use
@param outputNum Output number
@return F-beta for the given output | [
"Calculate",
"the",
"F",
"-",
"beta",
"value",
"for",
"the",
"given",
"output"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L414-L419 |
128,285 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.matthewsCorrelation | public double matthewsCorrelation(int outputNum) {
assertIndex(outputNum);
return EvaluationUtils.matthewsCorrelation(truePositives(outputNum), falsePositives(outputNum),
falseNegatives(outputNum), trueNegatives(outputNum));
} | java | public double matthewsCorrelation(int outputNum) {
assertIndex(outputNum);
return EvaluationUtils.matthewsCorrelation(truePositives(outputNum), falsePositives(outputNum),
falseNegatives(outputNum), trueNegatives(outputNum));
} | [
"public",
"double",
"matthewsCorrelation",
"(",
"int",
"outputNum",
")",
"{",
"assertIndex",
"(",
"outputNum",
")",
";",
"return",
"EvaluationUtils",
".",
"matthewsCorrelation",
"(",
"truePositives",
"(",
"outputNum",
")",
",",
"falsePositives",
"(",
"outputNum",
... | Calculate the Matthews correlation coefficient for the specified output
@param outputNum Output number
@return Matthews correlation coefficient | [
"Calculate",
"the",
"Matthews",
"correlation",
"coefficient",
"for",
"the",
"specified",
"output"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L434-L439 |
128,286 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.gMeasure | public double gMeasure(int output) {
double precision = precision(output);
double recall = recall(output);
return EvaluationUtils.gMeasure(precision, recall);
} | java | public double gMeasure(int output) {
double precision = precision(output);
double recall = recall(output);
return EvaluationUtils.gMeasure(precision, recall);
} | [
"public",
"double",
"gMeasure",
"(",
"int",
"output",
")",
"{",
"double",
"precision",
"=",
"precision",
"(",
"output",
")",
";",
"double",
"recall",
"=",
"recall",
"(",
"output",
")",
";",
"return",
"EvaluationUtils",
".",
"gMeasure",
"(",
"precision",
",... | Calculate the G-measure for the given output
@param output The specified output
@return The G-measure for the specified output | [
"Calculate",
"the",
"G",
"-",
"measure",
"for",
"the",
"given",
"output"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L447-L451 |
128,287 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.falseNegativeRate | public double falseNegativeRate(Integer classLabel, double edgeCase) {
double fnCount = falseNegatives(classLabel);
double tpCount = truePositives(classLabel);
return EvaluationUtils.falseNegativeRate((long) fnCount, (long) tpCount, edgeCase);
} | java | public double falseNegativeRate(Integer classLabel, double edgeCase) {
double fnCount = falseNegatives(classLabel);
double tpCount = truePositives(classLabel);
return EvaluationUtils.falseNegativeRate((long) fnCount, (long) tpCount, edgeCase);
} | [
"public",
"double",
"falseNegativeRate",
"(",
"Integer",
"classLabel",
",",
"double",
"edgeCase",
")",
"{",
"double",
"fnCount",
"=",
"falseNegatives",
"(",
"classLabel",
")",
";",
"double",
"tpCount",
"=",
"truePositives",
"(",
"classLabel",
")",
";",
"return",... | Returns the false negative rate for a given label
@param classLabel the label
@param edgeCase What to output in case of 0/0
@return fnr as a double | [
"Returns",
"the",
"false",
"negative",
"rate",
"for",
"a",
"given",
"label"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L495-L500 |
128,288 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java | EvaluationBinary.stats | public String stats(int printPrecision) {
StringBuilder sb = new StringBuilder();
//Report: Accuracy, precision, recall, F1. Then: confusion matrix
int maxLabelsLength = 15;
if (labels != null) {
for (String s : labels) {
maxLabelsLength = Math.max(s.length... | java | public String stats(int printPrecision) {
StringBuilder sb = new StringBuilder();
//Report: Accuracy, precision, recall, F1. Then: confusion matrix
int maxLabelsLength = 15;
if (labels != null) {
for (String s : labels) {
maxLabelsLength = Math.max(s.length... | [
"public",
"String",
"stats",
"(",
"int",
"printPrecision",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"//Report: Accuracy, precision, recall, F1. Then: confusion matrix",
"int",
"maxLabelsLength",
"=",
"15",
";",
"if",
"(",
"labels",
... | Get a String representation of the EvaluationBinary class, using the specified precision
@param printPrecision The precision (number of decimal places) for the accuracy, f1, etc. | [
"Get",
"a",
"String",
"representation",
"of",
"the",
"EvaluationBinary",
"class",
"using",
"the",
"specified",
"precision"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L560-L630 |
128,289 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintSimilarityComputer.java | FingerprintSimilarityComputer.getFingerprintsSimilarity | public FingerprintSimilarity getFingerprintsSimilarity() {
HashMap<Integer, Integer> offset_Score_Table = new HashMap<>(); // offset_Score_Table<offset,count>
int numFrames;
float score = 0;
int mostSimilarFramePosition = Integer.MIN_VALUE;
// one frame may contain several point... | java | public FingerprintSimilarity getFingerprintsSimilarity() {
HashMap<Integer, Integer> offset_Score_Table = new HashMap<>(); // offset_Score_Table<offset,count>
int numFrames;
float score = 0;
int mostSimilarFramePosition = Integer.MIN_VALUE;
// one frame may contain several point... | [
"public",
"FingerprintSimilarity",
"getFingerprintsSimilarity",
"(",
")",
"{",
"HashMap",
"<",
"Integer",
",",
"Integer",
">",
"offset_Score_Table",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"// offset_Score_Table<offset,count>",
"int",
"numFrames",
";",
"float",
... | Get fingerprint similarity of inout fingerprints
@return fingerprint similarity object | [
"Get",
"fingerprint",
"similarity",
"of",
"inout",
"fingerprints"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintSimilarityComputer.java#L52-L135 |
128,290 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/GraphTransformUtil.java | GraphTransformUtil.getSubgraphsMatching | public static List<SubGraph> getSubgraphsMatching(SameDiff sd, SubGraphPredicate p) {
List<SubGraph> out = new ArrayList<>();
for (DifferentialFunction df : sd.functions()) {
if (p.matches(sd, df)) {
SubGraph sg = p.getSubGraph(sd, df);
out.add(sg);
... | java | public static List<SubGraph> getSubgraphsMatching(SameDiff sd, SubGraphPredicate p) {
List<SubGraph> out = new ArrayList<>();
for (DifferentialFunction df : sd.functions()) {
if (p.matches(sd, df)) {
SubGraph sg = p.getSubGraph(sd, df);
out.add(sg);
... | [
"public",
"static",
"List",
"<",
"SubGraph",
">",
"getSubgraphsMatching",
"(",
"SameDiff",
"sd",
",",
"SubGraphPredicate",
"p",
")",
"{",
"List",
"<",
"SubGraph",
">",
"out",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"DifferentialFunction",
... | Get a list of all the subgraphs that match the specified predicate
@param sd SameDiff instance to get the subgraphs for
@param p Subgraph predicate. This defines the subgraphs that should be selected in the SameDiff instance
@return Subgraphs | [
"Get",
"a",
"list",
"of",
"all",
"the",
"subgraphs",
"that",
"match",
"the",
"specified",
"predicate"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/GraphTransformUtil.java#L179-L189 |
128,291 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.confusionMatrix | public String confusionMatrix(){
int nClasses = numClasses();
if(confusion == null){
return "Confusion matrix: <no data>";
}
//First: work out the maximum count
List<Integer> classes = confusion.getClasses();
int maxCount = 1;
for (Integer i : classe... | java | public String confusionMatrix(){
int nClasses = numClasses();
if(confusion == null){
return "Confusion matrix: <no data>";
}
//First: work out the maximum count
List<Integer> classes = confusion.getClasses();
int maxCount = 1;
for (Integer i : classe... | [
"public",
"String",
"confusionMatrix",
"(",
")",
"{",
"int",
"nClasses",
"=",
"numClasses",
"(",
")",
";",
"if",
"(",
"confusion",
"==",
"null",
")",
"{",
"return",
"\"Confusion matrix: <no data>\"",
";",
"}",
"//First: work out the maximum count",
"List",
"<",
... | Get the confusion matrix as a String
@return Confusion matrix as a String | [
"Get",
"the",
"confusion",
"matrix",
"as",
"a",
"String"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L725-L773 |
128,292 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.precision | public double precision(Integer classLabel, double edgeCase) {
double tpCount = truePositives.getCount(classLabel);
double fpCount = falsePositives.getCount(classLabel);
return EvaluationUtils.precision((long) tpCount, (long) fpCount, edgeCase);
} | java | public double precision(Integer classLabel, double edgeCase) {
double tpCount = truePositives.getCount(classLabel);
double fpCount = falsePositives.getCount(classLabel);
return EvaluationUtils.precision((long) tpCount, (long) fpCount, edgeCase);
} | [
"public",
"double",
"precision",
"(",
"Integer",
"classLabel",
",",
"double",
"edgeCase",
")",
"{",
"double",
"tpCount",
"=",
"truePositives",
".",
"getCount",
"(",
"classLabel",
")",
";",
"double",
"fpCount",
"=",
"falsePositives",
".",
"getCount",
"(",
"clas... | Returns the precision for a given label
@param classLabel the label
@param edgeCase What to output in case of 0/0
@return the precision for the label | [
"Returns",
"the",
"precision",
"for",
"a",
"given",
"label"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L822-L826 |
128,293 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.recall | public double recall(int classLabel, double edgeCase) {
double tpCount = truePositives.getCount(classLabel);
double fnCount = falseNegatives.getCount(classLabel);
return EvaluationUtils.recall((long) tpCount, (long) fnCount, edgeCase);
} | java | public double recall(int classLabel, double edgeCase) {
double tpCount = truePositives.getCount(classLabel);
double fnCount = falseNegatives.getCount(classLabel);
return EvaluationUtils.recall((long) tpCount, (long) fnCount, edgeCase);
} | [
"public",
"double",
"recall",
"(",
"int",
"classLabel",
",",
"double",
"edgeCase",
")",
"{",
"double",
"tpCount",
"=",
"truePositives",
".",
"getCount",
"(",
"classLabel",
")",
";",
"double",
"fnCount",
"=",
"falseNegatives",
".",
"getCount",
"(",
"classLabel"... | Returns the recall for a given label
@param classLabel the label
@param edgeCase What to output in case of 0/0
@return Recall rate as a double | [
"Returns",
"the",
"recall",
"for",
"a",
"given",
"label"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L968-L973 |
128,294 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.falsePositiveRate | public double falsePositiveRate(int classLabel, double edgeCase) {
double fpCount = falsePositives.getCount(classLabel);
double tnCount = trueNegatives.getCount(classLabel);
return EvaluationUtils.falsePositiveRate((long) fpCount, (long) tnCount, edgeCase);
} | java | public double falsePositiveRate(int classLabel, double edgeCase) {
double fpCount = falsePositives.getCount(classLabel);
double tnCount = trueNegatives.getCount(classLabel);
return EvaluationUtils.falsePositiveRate((long) fpCount, (long) tnCount, edgeCase);
} | [
"public",
"double",
"falsePositiveRate",
"(",
"int",
"classLabel",
",",
"double",
"edgeCase",
")",
"{",
"double",
"fpCount",
"=",
"falsePositives",
".",
"getCount",
"(",
"classLabel",
")",
";",
"double",
"tnCount",
"=",
"trueNegatives",
".",
"getCount",
"(",
"... | Returns the false positive rate for a given label
@param classLabel the label
@param edgeCase What to output in case of 0/0
@return fpr as a double | [
"Returns",
"the",
"false",
"positive",
"rate",
"for",
"a",
"given",
"label"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L1048-L1053 |
128,295 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.falsePositiveRate | public double falsePositiveRate(EvaluationAveraging averaging) {
int nClasses = confusion().getClasses().size();
if (averaging == EvaluationAveraging.Macro) {
double macroFPR = 0.0;
for (int i = 0; i < nClasses; i++) {
macroFPR += falsePositiveRate(i);
... | java | public double falsePositiveRate(EvaluationAveraging averaging) {
int nClasses = confusion().getClasses().size();
if (averaging == EvaluationAveraging.Macro) {
double macroFPR = 0.0;
for (int i = 0; i < nClasses; i++) {
macroFPR += falsePositiveRate(i);
... | [
"public",
"double",
"falsePositiveRate",
"(",
"EvaluationAveraging",
"averaging",
")",
"{",
"int",
"nClasses",
"=",
"confusion",
"(",
")",
".",
"getClasses",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"averaging",
"==",
"EvaluationAveraging",
".",
"Mac... | Calculate the average false positive rate across all classes. Can specify whether macro or micro averaging should be used
@param averaging Averaging method - macro or micro
@return Average false positive rate | [
"Calculate",
"the",
"average",
"false",
"positive",
"rate",
"across",
"all",
"classes",
".",
"Can",
"specify",
"whether",
"macro",
"or",
"micro",
"averaging",
"should",
"be",
"used"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L1080-L1100 |
128,296 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.falseNegativeRate | public double falseNegativeRate(EvaluationAveraging averaging) {
int nClasses = confusion().getClasses().size();
if (averaging == EvaluationAveraging.Macro) {
double macroFNR = 0.0;
for (int i = 0; i < nClasses; i++) {
macroFNR += falseNegativeRate(i);
... | java | public double falseNegativeRate(EvaluationAveraging averaging) {
int nClasses = confusion().getClasses().size();
if (averaging == EvaluationAveraging.Macro) {
double macroFNR = 0.0;
for (int i = 0; i < nClasses; i++) {
macroFNR += falseNegativeRate(i);
... | [
"public",
"double",
"falseNegativeRate",
"(",
"EvaluationAveraging",
"averaging",
")",
"{",
"int",
"nClasses",
"=",
"confusion",
"(",
")",
".",
"getClasses",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"averaging",
"==",
"EvaluationAveraging",
".",
"Mac... | Calculate the average false negative rate for all classes - can specify whether macro or micro averaging should be used
@param averaging Averaging method - macro or micro
@return Average false negative rate | [
"Calculate",
"the",
"average",
"false",
"negative",
"rate",
"for",
"all",
"classes",
"-",
"can",
"specify",
"whether",
"macro",
"or",
"micro",
"averaging",
"should",
"be",
"used"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L1151-L1171 |
128,297 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.fBeta | public double fBeta(double beta, EvaluationAveraging averaging) {
if(getNumRowCounter() == 0.0){
return Double.NaN; //No data
}
int nClasses = confusion().getClasses().size();
if (nClasses == 2) {
return EvaluationUtils.fBeta(beta, (long) truePositives.getCount(... | java | public double fBeta(double beta, EvaluationAveraging averaging) {
if(getNumRowCounter() == 0.0){
return Double.NaN; //No data
}
int nClasses = confusion().getClasses().size();
if (nClasses == 2) {
return EvaluationUtils.fBeta(beta, (long) truePositives.getCount(... | [
"public",
"double",
"fBeta",
"(",
"double",
"beta",
",",
"EvaluationAveraging",
"averaging",
")",
"{",
"if",
"(",
"getNumRowCounter",
"(",
")",
"==",
"0.0",
")",
"{",
"return",
"Double",
".",
"NaN",
";",
"//No data",
"}",
"int",
"nClasses",
"=",
"confusion... | Calculate the average F_beta score across all classes, using macro or micro averaging
@param beta Beta value to use
@param averaging Averaging method to use | [
"Calculate",
"the",
"average",
"F_beta",
"score",
"across",
"all",
"classes",
"using",
"macro",
"or",
"micro",
"averaging"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L1273-L1309 |
128,298 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.gMeasure | public double gMeasure(EvaluationAveraging averaging) {
int nClasses = confusion().getClasses().size();
if (averaging == EvaluationAveraging.Macro) {
double macroGMeasure = 0.0;
for (int i = 0; i < nClasses; i++) {
macroGMeasure += gMeasure(i);
}
... | java | public double gMeasure(EvaluationAveraging averaging) {
int nClasses = confusion().getClasses().size();
if (averaging == EvaluationAveraging.Macro) {
double macroGMeasure = 0.0;
for (int i = 0; i < nClasses; i++) {
macroGMeasure += gMeasure(i);
}
... | [
"public",
"double",
"gMeasure",
"(",
"EvaluationAveraging",
"averaging",
")",
"{",
"int",
"nClasses",
"=",
"confusion",
"(",
")",
".",
"getClasses",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"averaging",
"==",
"EvaluationAveraging",
".",
"Macro",
")... | Calculates the average G measure for all outputs using micro or macro averaging
@param averaging Averaging method to use
@return Average G measure | [
"Calculates",
"the",
"average",
"G",
"measure",
"for",
"all",
"outputs",
"using",
"micro",
"or",
"macro",
"averaging"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L1329-L1353 |
128,299 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.merge | @Override
public void merge(Evaluation other) {
if (other == null)
return;
truePositives.incrementAll(other.truePositives);
falsePositives.incrementAll(other.falsePositives);
trueNegatives.incrementAll(other.trueNegatives);
falseNegatives.incrementAll(other.false... | java | @Override
public void merge(Evaluation other) {
if (other == null)
return;
truePositives.incrementAll(other.truePositives);
falsePositives.incrementAll(other.falsePositives);
trueNegatives.incrementAll(other.trueNegatives);
falseNegatives.incrementAll(other.false... | [
"@",
"Override",
"public",
"void",
"merge",
"(",
"Evaluation",
"other",
")",
"{",
"if",
"(",
"other",
"==",
"null",
")",
"return",
";",
"truePositives",
".",
"incrementAll",
"(",
"other",
".",
"truePositives",
")",
";",
"falsePositives",
".",
"incrementAll",... | Merge the other evaluation object into this one. The result is that this Evaluation instance contains the counts
etc from both
@param other Evaluation object to merge into this one. | [
"Merge",
"the",
"other",
"evaluation",
"object",
"into",
"this",
"one",
".",
"The",
"result",
"is",
"that",
"this",
"Evaluation",
"instance",
"contains",
"the",
"counts",
"etc",
"from",
"both"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L1611-L1638 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.