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,100 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java | Hdf5Archive.getObjects | private List<String> getObjects(Group fileGroup, int objType) {
synchronized (Hdf5Archive.LOCK_OBJECT) {
List<String> groups = new ArrayList<>();
for (int i = 0; i < fileGroup.getNumObjs(); i++) {
BytePointer objPtr = fileGroup.getObjnameByIdx(i);
if (file... | java | private List<String> getObjects(Group fileGroup, int objType) {
synchronized (Hdf5Archive.LOCK_OBJECT) {
List<String> groups = new ArrayList<>();
for (int i = 0; i < fileGroup.getNumObjs(); i++) {
BytePointer objPtr = fileGroup.getObjnameByIdx(i);
if (file... | [
"private",
"List",
"<",
"String",
">",
"getObjects",
"(",
"Group",
"fileGroup",
",",
"int",
"objType",
")",
"{",
"synchronized",
"(",
"Hdf5Archive",
".",
"LOCK_OBJECT",
")",
"{",
"List",
"<",
"String",
">",
"groups",
"=",
"new",
"ArrayList",
"<>",
"(",
"... | Get list of objects with a given type from a file group.
@param fileGroup HDF5 file or group
@param objType Type of object as integer
@return List of HDF5 group objects | [
"Get",
"list",
"of",
"objects",
"with",
"a",
"given",
"type",
"from",
"a",
"file",
"group",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java#L319-L329 |
128,101 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java | Hdf5Archive.readAttributeAsJson | private String readAttributeAsJson(Attribute attribute) throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
VarLenType vl = attribute.getVarLenType();
int bufferSizeMult = 1;
String s;
/* TODO: find a less hacky way to do this.... | java | private String readAttributeAsJson(Attribute attribute) throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
VarLenType vl = attribute.getVarLenType();
int bufferSizeMult = 1;
String s;
/* TODO: find a less hacky way to do this.... | [
"private",
"String",
"readAttributeAsJson",
"(",
"Attribute",
"attribute",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"synchronized",
"(",
"Hdf5Archive",
".",
"LOCK_OBJECT",
")",
"{",
"VarLenType",
"vl",
"=",
"attribute",
".",
"getVarLenType",
"(",
... | Read JSON-formatted string attribute.
@param attribute HDF5 attribute to read as JSON formatted string.
@return JSON formatted string from HDF5 attribute
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Read",
"JSON",
"-",
"formatted",
"string",
"attribute",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java#L338-L373 |
128,102 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java | Hdf5Archive.readAttributeAsString | private String readAttributeAsString(Attribute attribute) throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
VarLenType vl = attribute.getVarLenType();
int bufferSizeMult = 1;
String s = null;
/* TODO: find a less hacky way to... | java | private String readAttributeAsString(Attribute attribute) throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
VarLenType vl = attribute.getVarLenType();
int bufferSizeMult = 1;
String s = null;
/* TODO: find a less hacky way to... | [
"private",
"String",
"readAttributeAsString",
"(",
"Attribute",
"attribute",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"synchronized",
"(",
"Hdf5Archive",
".",
"LOCK_OBJECT",
")",
"{",
"VarLenType",
"vl",
"=",
"attribute",
".",
"getVarLenType",
"(",
... | Read attribute as string.
@param attribute HDF5 attribute to read as string.
@return HDF5 attribute as string
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Read",
"attribute",
"as",
"string",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java#L382-L414 |
128,103 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java | Hdf5Archive.readAttributeAsFixedLengthString | public String readAttributeAsFixedLengthString(String attributeName, int bufferSize)
throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
Attribute a = this.file.openAttribute(attributeName);
String s = readAttributeAsFixedLengthString(a, b... | java | public String readAttributeAsFixedLengthString(String attributeName, int bufferSize)
throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
Attribute a = this.file.openAttribute(attributeName);
String s = readAttributeAsFixedLengthString(a, b... | [
"public",
"String",
"readAttributeAsFixedLengthString",
"(",
"String",
"attributeName",
",",
"int",
"bufferSize",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"synchronized",
"(",
"Hdf5Archive",
".",
"LOCK_OBJECT",
")",
"{",
"Attribute",
"a",
"=",
"this... | Read string attribute from group path.
@param attributeName Name of attribute
@param bufferSize buffer size to read
@return Fixed-length string read from HDF5 attribute name
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Read",
"string",
"attribute",
"from",
"group",
"path",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java#L424-L432 |
128,104 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java | Hdf5Archive.readAttributeAsFixedLengthString | private String readAttributeAsFixedLengthString(Attribute attribute, int bufferSize)
throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
VarLenType vl = attribute.getVarLenType();
byte[] attrBuffer = new byte[bufferSize];
ByteP... | java | private String readAttributeAsFixedLengthString(Attribute attribute, int bufferSize)
throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
VarLenType vl = attribute.getVarLenType();
byte[] attrBuffer = new byte[bufferSize];
ByteP... | [
"private",
"String",
"readAttributeAsFixedLengthString",
"(",
"Attribute",
"attribute",
",",
"int",
"bufferSize",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"synchronized",
"(",
"Hdf5Archive",
".",
"LOCK_OBJECT",
")",
"{",
"VarLenType",
"vl",
"=",
"at... | Read attribute of fixed buffer size as string.
@param attribute HDF5 attribute to read as string.
@return Fixed-length string read from HDF5 attribute
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Read",
"attribute",
"of",
"fixed",
"buffer",
"size",
"as",
"string",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java#L441-L452 |
128,105 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java | PCA.reducedBasis | public INDArray reducedBasis(double variance) {
INDArray vars = Transforms.pow(eigenvalues, -0.5, true);
double res = vars.sumNumber().doubleValue();
double total = 0.0;
int ndims = 0;
for (int i = 0; i < vars.columns(); i++) {
ndims++;
total += vars.getDo... | java | public INDArray reducedBasis(double variance) {
INDArray vars = Transforms.pow(eigenvalues, -0.5, true);
double res = vars.sumNumber().doubleValue();
double total = 0.0;
int ndims = 0;
for (int i = 0; i < vars.columns(); i++) {
ndims++;
total += vars.getDo... | [
"public",
"INDArray",
"reducedBasis",
"(",
"double",
"variance",
")",
"{",
"INDArray",
"vars",
"=",
"Transforms",
".",
"pow",
"(",
"eigenvalues",
",",
"-",
"0.5",
",",
"true",
")",
";",
"double",
"res",
"=",
"vars",
".",
"sumNumber",
"(",
")",
".",
"do... | Return a reduced basis set that covers a certain fraction of the variance of the data
@param variance The desired fractional variance (0 to 1), it will always be greater than the value.
@return The basis vectors as columns, size <i>N</i> rows by <i>ndims</i> columns, where <i>ndims</i> is less than or equal to <i>N</i> | [
"Return",
"a",
"reduced",
"basis",
"set",
"that",
"covers",
"a",
"certain",
"fraction",
"of",
"the",
"variance",
"of",
"the",
"data"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java#L58-L73 |
128,106 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java | PCA.convertToComponents | public INDArray convertToComponents(INDArray data) {
INDArray dx = data.subRowVector(mean);
return Nd4j.tensorMmul(eigenvectors.transpose(), dx, new int[][] {{1}, {1}}).transposei();
} | java | public INDArray convertToComponents(INDArray data) {
INDArray dx = data.subRowVector(mean);
return Nd4j.tensorMmul(eigenvectors.transpose(), dx, new int[][] {{1}, {1}}).transposei();
} | [
"public",
"INDArray",
"convertToComponents",
"(",
"INDArray",
"data",
")",
"{",
"INDArray",
"dx",
"=",
"data",
".",
"subRowVector",
"(",
"mean",
")",
";",
"return",
"Nd4j",
".",
"tensorMmul",
"(",
"eigenvectors",
".",
"transpose",
"(",
")",
",",
"dx",
",",... | Takes a set of data on each row, with the same number of features as the constructing data
and returns the data in the coordinates of the basis set about the mean.
@param data Data of the same features used to construct the PCA object
@return The record in terms of the principal component vectors, you can set unused on... | [
"Takes",
"a",
"set",
"of",
"data",
"on",
"each",
"row",
"with",
"the",
"same",
"number",
"of",
"features",
"as",
"the",
"constructing",
"data",
"and",
"returns",
"the",
"data",
"in",
"the",
"coordinates",
"of",
"the",
"basis",
"set",
"about",
"the",
"mea... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java#L82-L85 |
128,107 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java | PCA.convertBackToFeatures | public INDArray convertBackToFeatures(INDArray data) {
return Nd4j.tensorMmul(eigenvectors, data, new int[][] {{1}, {1}}).transposei().addiRowVector(mean);
} | java | public INDArray convertBackToFeatures(INDArray data) {
return Nd4j.tensorMmul(eigenvectors, data, new int[][] {{1}, {1}}).transposei().addiRowVector(mean);
} | [
"public",
"INDArray",
"convertBackToFeatures",
"(",
"INDArray",
"data",
")",
"{",
"return",
"Nd4j",
".",
"tensorMmul",
"(",
"eigenvectors",
",",
"data",
",",
"new",
"int",
"[",
"]",
"[",
"]",
"{",
"{",
"1",
"}",
",",
"{",
"1",
"}",
"}",
")",
".",
"... | Take the data that has been transformed to the principal components about the mean and
transform it back into the original feature set. Make sure to fill in zeroes in columns
where components were dropped!
@param data Data of the same features used to construct the PCA object but as the components
@return The records ... | [
"Take",
"the",
"data",
"that",
"has",
"been",
"transformed",
"to",
"the",
"principal",
"components",
"about",
"the",
"mean",
"and",
"transform",
"it",
"back",
"into",
"the",
"original",
"feature",
"set",
".",
"Make",
"sure",
"to",
"fill",
"in",
"zeroes",
"... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java#L95-L97 |
128,108 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java | PCA.pca | public static INDArray pca(INDArray A, int nDims, boolean normalize) {
INDArray factor = pca_factor(A, nDims, normalize);
return A.mmul(factor);
} | java | public static INDArray pca(INDArray A, int nDims, boolean normalize) {
INDArray factor = pca_factor(A, nDims, normalize);
return A.mmul(factor);
} | [
"public",
"static",
"INDArray",
"pca",
"(",
"INDArray",
"A",
",",
"int",
"nDims",
",",
"boolean",
"normalize",
")",
"{",
"INDArray",
"factor",
"=",
"pca_factor",
"(",
"A",
",",
"nDims",
",",
"normalize",
")",
";",
"return",
"A",
".",
"mmul",
"(",
"fact... | Calculates pca vectors of a matrix, for a flags number of reduced features
returns the reduced feature set
The return is a projection of A onto principal nDims components
To use the PCA: assume A is the original feature set
then project A onto a reduced set of features. It is possible to
reconstruct the original data ... | [
"Calculates",
"pca",
"vectors",
"of",
"a",
"matrix",
"for",
"a",
"flags",
"number",
"of",
"reduced",
"features",
"returns",
"the",
"reduced",
"feature",
"set",
"The",
"return",
"is",
"a",
"projection",
"of",
"A",
"onto",
"principal",
"nDims",
"components"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java#L154-L157 |
128,109 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java | PCA.pca_factor | public static INDArray pca_factor(INDArray A, int nDims, boolean normalize) {
if (normalize) {
// Normalize to mean 0 for each feature ( each column has 0 mean )
INDArray mean = A.mean(0);
A.subiRowVector(mean);
}
long m = A.rows();
long n = A.column... | java | public static INDArray pca_factor(INDArray A, int nDims, boolean normalize) {
if (normalize) {
// Normalize to mean 0 for each feature ( each column has 0 mean )
INDArray mean = A.mean(0);
A.subiRowVector(mean);
}
long m = A.rows();
long n = A.column... | [
"public",
"static",
"INDArray",
"pca_factor",
"(",
"INDArray",
"A",
",",
"int",
"nDims",
",",
"boolean",
"normalize",
")",
"{",
"if",
"(",
"normalize",
")",
"{",
"// Normalize to mean 0 for each feature ( each column has 0 mean )",
"INDArray",
"mean",
"=",
"A",
".",... | Calculates pca factors of a matrix, for a flags number of reduced features
returns the factors to scale observations
The return is a factor matrix to reduce (normalized) feature sets
@see pca(INDArray, int, boolean)
@param A the array of features, rows are results, columns are features - will be changed
@param nDims... | [
"Calculates",
"pca",
"factors",
"of",
"a",
"matrix",
"for",
"a",
"flags",
"number",
"of",
"reduced",
"features",
"returns",
"the",
"factors",
"to",
"scale",
"observations"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java#L173-L202 |
128,110 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java | PCA.pca2 | public static INDArray pca2(INDArray in, double variance) {
// let's calculate the covariance and the mean
INDArray[] covmean = covarianceMatrix(in);
// use the covariance matrix (inverse) to find "force constants" and then break into orthonormal
// unit vector components
INDArra... | java | public static INDArray pca2(INDArray in, double variance) {
// let's calculate the covariance and the mean
INDArray[] covmean = covarianceMatrix(in);
// use the covariance matrix (inverse) to find "force constants" and then break into orthonormal
// unit vector components
INDArra... | [
"public",
"static",
"INDArray",
"pca2",
"(",
"INDArray",
"in",
",",
"double",
"variance",
")",
"{",
"// let's calculate the covariance and the mean",
"INDArray",
"[",
"]",
"covmean",
"=",
"covarianceMatrix",
"(",
"in",
")",
";",
"// use the covariance matrix (inverse) t... | This method performs a dimensionality reduction, including principal components
that cover a fraction of the total variance of the system. It does all calculations
about the mean.
@param in A matrix of datapoints as rows, where column are features with fixed number N
@param variance The desired fraction of the total v... | [
"This",
"method",
"performs",
"a",
"dimensionality",
"reduction",
"including",
"principal",
"components",
"that",
"cover",
"a",
"fraction",
"of",
"the",
"total",
"variance",
"of",
"the",
"system",
".",
"It",
"does",
"all",
"calculations",
"about",
"the",
"mean",... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java#L298-L319 |
128,111 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/Wave.java | Wave.timestamp | public String timestamp() {
float totalSeconds = this.length();
float second = totalSeconds % 60;
int minute = (int) totalSeconds / 60 % 60;
int hour = (int) (totalSeconds / 3600);
StringBuilder sb = new StringBuilder();
if (hour > 0) {
sb.append(hour + ":");... | java | public String timestamp() {
float totalSeconds = this.length();
float second = totalSeconds % 60;
int minute = (int) totalSeconds / 60 % 60;
int hour = (int) (totalSeconds / 3600);
StringBuilder sb = new StringBuilder();
if (hour > 0) {
sb.append(hour + ":");... | [
"public",
"String",
"timestamp",
"(",
")",
"{",
"float",
"totalSeconds",
"=",
"this",
".",
"length",
"(",
")",
";",
"float",
"second",
"=",
"totalSeconds",
"%",
"60",
";",
"int",
"minute",
"=",
"(",
"int",
")",
"totalSeconds",
"/",
"60",
"%",
"60",
"... | Timestamp of the wave length
@return timestamp | [
"Timestamp",
"of",
"the",
"wave",
"length"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/Wave.java#L264-L280 |
128,112 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java | FingerprintManager.getFingerprintFromFile | public byte[] getFingerprintFromFile(String fingerprintFile) {
byte[] fingerprint = null;
try {
InputStream fis = new FileInputStream(fingerprintFile);
fingerprint = getFingerprintFromInputStream(fis);
fis.close();
} catch (IOException e) {
e.print... | java | public byte[] getFingerprintFromFile(String fingerprintFile) {
byte[] fingerprint = null;
try {
InputStream fis = new FileInputStream(fingerprintFile);
fingerprint = getFingerprintFromInputStream(fis);
fis.close();
} catch (IOException e) {
e.print... | [
"public",
"byte",
"[",
"]",
"getFingerprintFromFile",
"(",
"String",
"fingerprintFile",
")",
"{",
"byte",
"[",
"]",
"fingerprint",
"=",
"null",
";",
"try",
"{",
"InputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"fingerprintFile",
")",
";",
"fingerprint... | Get bytes from fingerprint file
@param fingerprintFile fingerprint filename
@return fingerprint in bytes | [
"Get",
"bytes",
"from",
"fingerprint",
"file"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java#L149-L159 |
128,113 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java | FingerprintManager.getFingerprintFromInputStream | public byte[] getFingerprintFromInputStream(InputStream inputStream) {
byte[] fingerprint = null;
try {
fingerprint = new byte[inputStream.available()];
inputStream.read(fingerprint);
} catch (IOException e) {
e.printStackTrace();
}
return fing... | java | public byte[] getFingerprintFromInputStream(InputStream inputStream) {
byte[] fingerprint = null;
try {
fingerprint = new byte[inputStream.available()];
inputStream.read(fingerprint);
} catch (IOException e) {
e.printStackTrace();
}
return fing... | [
"public",
"byte",
"[",
"]",
"getFingerprintFromInputStream",
"(",
"InputStream",
"inputStream",
")",
"{",
"byte",
"[",
"]",
"fingerprint",
"=",
"null",
";",
"try",
"{",
"fingerprint",
"=",
"new",
"byte",
"[",
"inputStream",
".",
"available",
"(",
")",
"]",
... | Get bytes from fingerprint inputstream
@param inputStream fingerprint inputstream
@return fingerprint in bytes | [
"Get",
"bytes",
"from",
"fingerprint",
"inputstream"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java#L167-L176 |
128,114 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java | FingerprintManager.saveFingerprintAsFile | public void saveFingerprintAsFile(byte[] fingerprint, String filename) {
FileOutputStream fileOutputStream;
try {
fileOutputStream = new FileOutputStream(filename);
fileOutputStream.write(fingerprint);
fileOutputStream.close();
} catch (IOException e) {
... | java | public void saveFingerprintAsFile(byte[] fingerprint, String filename) {
FileOutputStream fileOutputStream;
try {
fileOutputStream = new FileOutputStream(filename);
fileOutputStream.write(fingerprint);
fileOutputStream.close();
} catch (IOException e) {
... | [
"public",
"void",
"saveFingerprintAsFile",
"(",
"byte",
"[",
"]",
"fingerprint",
",",
"String",
"filename",
")",
"{",
"FileOutputStream",
"fileOutputStream",
";",
"try",
"{",
"fileOutputStream",
"=",
"new",
"FileOutputStream",
"(",
"filename",
")",
";",
"fileOutpu... | Save fingerprint to a file
@param fingerprint fingerprint bytes
@param filename fingerprint filename
@see FingerprintManager file saved | [
"Save",
"fingerprint",
"to",
"a",
"file"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java#L185-L195 |
128,115 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/util/BaseLabels.java | BaseLabels.getLabels | protected ArrayList<String> getLabels(String textResource) throws IOException {
ArrayList<String> labels = new ArrayList<>();
File resourceFile = getResourceFile(); //Download if required
try (InputStream is = new BufferedInputStream(new FileInputStream(resourceFile)); Scanner s = new Scanner(i... | java | protected ArrayList<String> getLabels(String textResource) throws IOException {
ArrayList<String> labels = new ArrayList<>();
File resourceFile = getResourceFile(); //Download if required
try (InputStream is = new BufferedInputStream(new FileInputStream(resourceFile)); Scanner s = new Scanner(i... | [
"protected",
"ArrayList",
"<",
"String",
">",
"getLabels",
"(",
"String",
"textResource",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"String",
">",
"labels",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"File",
"resourceFile",
"=",
"getResourceFile"... | Returns labels based on the text file resource. | [
"Returns",
"labels",
"based",
"on",
"the",
"text",
"file",
"resource",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/util/BaseLabels.java#L66-L75 |
128,116 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/sequence/SequenceElement.java | SequenceElement.setPoints | @JsonIgnore
public void setPoints(int[] points) {
this.points = new ArrayList<>();
for (int i = 0; i < points.length; i++) {
this.points.add(points[i]);
}
} | java | @JsonIgnore
public void setPoints(int[] points) {
this.points = new ArrayList<>();
for (int i = 0; i < points.length; i++) {
this.points.add(points[i]);
}
} | [
"@",
"JsonIgnore",
"public",
"void",
"setPoints",
"(",
"int",
"[",
"]",
"points",
")",
"{",
"this",
".",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"points",
".",
"length",
";",
"i",
... | Sets Huffman tree points
@param points | [
"Sets",
"Huffman",
"tree",
"points"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/sequence/SequenceElement.java#L256-L262 |
128,117 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java | BasicNDArrayCompressor.printAvailableCompressors | public void printAvailableCompressors() {
StringBuilder builder = new StringBuilder();
builder.append("Available compressors: ");
for (String comp : codecs.keySet()) {
builder.append("[").append(comp).append("] ");
}
System.out.println(builder.toString());
} | java | public void printAvailableCompressors() {
StringBuilder builder = new StringBuilder();
builder.append("Available compressors: ");
for (String comp : codecs.keySet()) {
builder.append("[").append(comp).append("] ");
}
System.out.println(builder.toString());
} | [
"public",
"void",
"printAvailableCompressors",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"Available compressors: \"",
")",
";",
"for",
"(",
"String",
"comp",
":",
"codecs",
".",
"key... | Prints available compressors to standard out | [
"Prints",
"available",
"compressors",
"to",
"standard",
"out"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java#L80-L88 |
128,118 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java | BasicNDArrayCompressor.compress | public DataBuffer compress(DataBuffer buffer, String algorithm) {
algorithm = algorithm.toUpperCase();
if (!codecs.containsKey(algorithm))
throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]");
return codecs.get(algorithm).compress(buffer);
... | java | public DataBuffer compress(DataBuffer buffer, String algorithm) {
algorithm = algorithm.toUpperCase();
if (!codecs.containsKey(algorithm))
throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]");
return codecs.get(algorithm).compress(buffer);
... | [
"public",
"DataBuffer",
"compress",
"(",
"DataBuffer",
"buffer",
",",
"String",
"algorithm",
")",
"{",
"algorithm",
"=",
"algorithm",
".",
"toUpperCase",
"(",
")",
";",
"if",
"(",
"!",
"codecs",
".",
"containsKey",
"(",
"algorithm",
")",
")",
"throw",
"new... | Compress the data buffer
given a specified algorithm
@param buffer the buffer to compress
@param algorithm the algorithm to compress
use
@return the compressed data buffer | [
"Compress",
"the",
"data",
"buffer",
"given",
"a",
"specified",
"algorithm"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java#L146-L152 |
128,119 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java | BasicNDArrayCompressor.compress | public INDArray compress(INDArray array, String algorithm) {
algorithm = algorithm.toUpperCase();
if (!codecs.containsKey(algorithm))
throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]");
return codecs.get(algorithm).compress(array);
} | java | public INDArray compress(INDArray array, String algorithm) {
algorithm = algorithm.toUpperCase();
if (!codecs.containsKey(algorithm))
throw new RuntimeException("Non-existent compression algorithm requested: [" + algorithm + "]");
return codecs.get(algorithm).compress(array);
} | [
"public",
"INDArray",
"compress",
"(",
"INDArray",
"array",
",",
"String",
"algorithm",
")",
"{",
"algorithm",
"=",
"algorithm",
".",
"toUpperCase",
"(",
")",
";",
"if",
"(",
"!",
"codecs",
".",
"containsKey",
"(",
"algorithm",
")",
")",
"throw",
"new",
... | Returns a compressed version of the
given ndarray
@param array the array to compress
@param algorithm the algorithm to compress with
@return a compressed copy of this ndarray | [
"Returns",
"a",
"compressed",
"version",
"of",
"the",
"given",
"ndarray"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java#L178-L184 |
128,120 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java | BasicNDArrayCompressor.decompress | public DataBuffer decompress(DataBuffer buffer, DataType targetType) {
if (buffer.dataType() != DataType.COMPRESSED)
throw new IllegalStateException("You can't decompress DataBuffer with dataType of: " + buffer.dataType());
CompressedDataBuffer comp = (CompressedDataBuffer) buffer;
... | java | public DataBuffer decompress(DataBuffer buffer, DataType targetType) {
if (buffer.dataType() != DataType.COMPRESSED)
throw new IllegalStateException("You can't decompress DataBuffer with dataType of: " + buffer.dataType());
CompressedDataBuffer comp = (CompressedDataBuffer) buffer;
... | [
"public",
"DataBuffer",
"decompress",
"(",
"DataBuffer",
"buffer",
",",
"DataType",
"targetType",
")",
"{",
"if",
"(",
"buffer",
".",
"dataType",
"(",
")",
"!=",
"DataType",
".",
"COMPRESSED",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"You can't decom... | Decompress the given databuffer
@param buffer the databuffer to compress
@return the decompressed databuffer | [
"Decompress",
"the",
"given",
"databuffer"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java#L205-L217 |
128,121 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java | BasicNDArrayCompressor.decompressi | public void decompressi(INDArray array) {
if (array.data().dataType() != DataType.COMPRESSED)
return;
val comp = (CompressedDataBuffer) array.data();
val descriptor = comp.getCompressionDescriptor();
if (!codecs.containsKey(descriptor.getCompressionAlgorithm()))
... | java | public void decompressi(INDArray array) {
if (array.data().dataType() != DataType.COMPRESSED)
return;
val comp = (CompressedDataBuffer) array.data();
val descriptor = comp.getCompressionDescriptor();
if (!codecs.containsKey(descriptor.getCompressionAlgorithm()))
... | [
"public",
"void",
"decompressi",
"(",
"INDArray",
"array",
")",
"{",
"if",
"(",
"array",
".",
"data",
"(",
")",
".",
"dataType",
"(",
")",
"!=",
"DataType",
".",
"COMPRESSED",
")",
"return",
";",
"val",
"comp",
"=",
"(",
"CompressedDataBuffer",
")",
"a... | in place decompression of the given
ndarray. If the ndarray isn't compressed
this will do nothing
@param array the array to decompressed
if it is comprssed | [
"in",
"place",
"decompression",
"of",
"the",
"given",
"ndarray",
".",
"If",
"the",
"ndarray",
"isn",
"t",
"compressed",
"this",
"will",
"do",
"nothing"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/BasicNDArrayCompressor.java#L249-L262 |
128,122 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/classimbalance/UnderSamplingByMaskingMultiDataSetPreProcessor.java | UnderSamplingByMaskingMultiDataSetPreProcessor.overrideMinorityDefault | public void overrideMinorityDefault(int index) {
if (targetMinorityDistMap.containsKey(index)) {
minorityLabelMap.put(index, 0);
} else {
throw new IllegalArgumentException(
"Index specified is not contained in the target minority distribution map spec... | java | public void overrideMinorityDefault(int index) {
if (targetMinorityDistMap.containsKey(index)) {
minorityLabelMap.put(index, 0);
} else {
throw new IllegalArgumentException(
"Index specified is not contained in the target minority distribution map spec... | [
"public",
"void",
"overrideMinorityDefault",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"targetMinorityDistMap",
".",
"containsKey",
"(",
"index",
")",
")",
"{",
"minorityLabelMap",
".",
"put",
"(",
"index",
",",
"0",
")",
";",
"}",
"else",
"{",
"throw",
... | Will change the default minority label from "1" to "0" and correspondingly the majority class from "0" to "1"
for the label at the index specified | [
"Will",
"change",
"the",
"default",
"minority",
"label",
"from",
"1",
"to",
"0",
"and",
"correspondingly",
"the",
"majority",
"class",
"from",
"0",
"to",
"1",
"for",
"the",
"label",
"at",
"the",
"index",
"specified"
] | 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/classimbalance/UnderSamplingByMaskingMultiDataSetPreProcessor.java#L62-L70 |
128,123 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java | RecordReaderConverter.convert | public static void convert(RecordReader reader, RecordWriter writer) throws IOException {
convert(reader, writer, true);
} | java | public static void convert(RecordReader reader, RecordWriter writer) throws IOException {
convert(reader, writer, true);
} | [
"public",
"static",
"void",
"convert",
"(",
"RecordReader",
"reader",
",",
"RecordWriter",
"writer",
")",
"throws",
"IOException",
"{",
"convert",
"(",
"reader",
",",
"writer",
",",
"true",
")",
";",
"}"
] | Write all values from the specified record reader to the specified record writer.
Closes the record writer on completion
@param reader Record reader (source of data)
@param writer Record writer (location to write data)
@throws IOException If underlying reader/writer throws an exception | [
"Write",
"all",
"values",
"from",
"the",
"specified",
"record",
"reader",
"to",
"the",
"specified",
"record",
"writer",
".",
"Closes",
"the",
"record",
"writer",
"on",
"completion"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java#L44-L46 |
128,124 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java | RecordReaderConverter.convert | public static void convert(RecordReader reader, RecordWriter writer, boolean closeOnCompletion) throws IOException {
if(!reader.hasNext()){
throw new UnsupportedOperationException("Cannot convert RecordReader: reader has no next element");
}
while(reader.hasNext()){
wri... | java | public static void convert(RecordReader reader, RecordWriter writer, boolean closeOnCompletion) throws IOException {
if(!reader.hasNext()){
throw new UnsupportedOperationException("Cannot convert RecordReader: reader has no next element");
}
while(reader.hasNext()){
wri... | [
"public",
"static",
"void",
"convert",
"(",
"RecordReader",
"reader",
",",
"RecordWriter",
"writer",
",",
"boolean",
"closeOnCompletion",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"reader",
".",
"hasNext",
"(",
")",
")",
"{",
"throw",
"new",
"Unsupp... | Write all values from the specified record reader to the specified record writer.
Optionally, close the record writer on completion
@param reader Record reader (source of data)
@param writer Record writer (location to write data)
@param closeOnCompletion if true: close the record writer once complete, via {@link Recor... | [
"Write",
"all",
"values",
"from",
"the",
"specified",
"record",
"reader",
"to",
"the",
"specified",
"record",
"writer",
".",
"Optionally",
"close",
"the",
"record",
"writer",
"on",
"completion"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java#L57-L70 |
128,125 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasConstraintUtils.java | KerasConstraintUtils.mapConstraint | public static LayerConstraint mapConstraint(String kerasConstraint, KerasLayerConfiguration conf,
Map<String, Object> constraintConfig)
throws UnsupportedKerasConfigurationException {
LayerConstraint constraint;
if (kerasConstraint.equals(conf.... | java | public static LayerConstraint mapConstraint(String kerasConstraint, KerasLayerConfiguration conf,
Map<String, Object> constraintConfig)
throws UnsupportedKerasConfigurationException {
LayerConstraint constraint;
if (kerasConstraint.equals(conf.... | [
"public",
"static",
"LayerConstraint",
"mapConstraint",
"(",
"String",
"kerasConstraint",
",",
"KerasLayerConfiguration",
"conf",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"constraintConfig",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"LayerConstra... | Map Keras to DL4J constraint.
@param kerasConstraint String containing Keras constraint name
@param conf Keras layer configuration
@return DL4J LayerConstraint
@see LayerConstraint | [
"Map",
"Keras",
"to",
"DL4J",
"constraint",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasConstraintUtils.java#L48-L79 |
128,126 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasConstraintUtils.java | KerasConstraintUtils.getConstraintsFromConfig | public static LayerConstraint getConstraintsFromConfig(Map<String, Object> layerConfig, String constraintField,
KerasLayerConfiguration conf, int kerasMajorVersion)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
... | java | public static LayerConstraint getConstraintsFromConfig(Map<String, Object> layerConfig, String constraintField,
KerasLayerConfiguration conf, int kerasMajorVersion)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
... | [
"public",
"static",
"LayerConstraint",
"getConstraintsFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
",",
"String",
"constraintField",
",",
"KerasLayerConfiguration",
"conf",
",",
"int",
"kerasMajorVersion",
")",
"throws",
"InvalidKerasConfig... | Get constraint initialization from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@param constraintField string in configuration representing parameter to constrain
@param conf Keras layer configuration
@param kerasMajorVersion Major keras version as ... | [
"Get",
"constraint",
"initialization",
"from",
"Keras",
"layer",
"configuration",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasConstraintUtils.java#L92-L121 |
128,127 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/BaseEvaluation.java | BaseEvaluation.attempFromLegacyFromJson | protected static <T extends IEvaluation> T attempFromLegacyFromJson(String json, IllegalArgumentException originalException) {
if (json.contains("org.deeplearning4j.eval.Evaluation")) {
String newJson = json.replaceAll("org.deeplearning4j.eval.Evaluation", "org.nd4j.evaluation.classification.Evaluat... | java | protected static <T extends IEvaluation> T attempFromLegacyFromJson(String json, IllegalArgumentException originalException) {
if (json.contains("org.deeplearning4j.eval.Evaluation")) {
String newJson = json.replaceAll("org.deeplearning4j.eval.Evaluation", "org.nd4j.evaluation.classification.Evaluat... | [
"protected",
"static",
"<",
"T",
"extends",
"IEvaluation",
">",
"T",
"attempFromLegacyFromJson",
"(",
"String",
"json",
",",
"IllegalArgumentException",
"originalException",
")",
"{",
"if",
"(",
"json",
".",
"contains",
"(",
"\"org.deeplearning4j.eval.Evaluation\"",
"... | Attempt to load DL4J IEvaluation JSON from 1.0.0-beta2 or earlier.
Given IEvaluation classes were moved to ND4J with no major changes, a simple "find and replace" for the class
names is used.
@param json JSON to attempt to deserialize
@param originalException Original exception to be re-thrown if it isn't... | [
"Attempt",
"to",
"load",
"DL4J",
"IEvaluation",
"JSON",
"from",
"1",
".",
"0",
".",
"0",
"-",
"beta2",
"or",
"earlier",
".",
"Given",
"IEvaluation",
"classes",
"were",
"moved",
"to",
"ND4J",
"with",
"no",
"major",
"changes",
"a",
"simple",
"find",
"and",... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/BaseEvaluation.java#L128-L174 |
128,128 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/JCublasNDArrayFactory.java | JCublasNDArrayFactory.shuffle | @Override
public void shuffle(INDArray array, Random rnd, int... dimension) {
shuffle(Collections.singletonList(array), rnd, dimension);
} | java | @Override
public void shuffle(INDArray array, Random rnd, int... dimension) {
shuffle(Collections.singletonList(array), rnd, dimension);
} | [
"@",
"Override",
"public",
"void",
"shuffle",
"(",
"INDArray",
"array",
",",
"Random",
"rnd",
",",
"int",
"...",
"dimension",
")",
"{",
"shuffle",
"(",
"Collections",
".",
"singletonList",
"(",
"array",
")",
",",
"rnd",
",",
"dimension",
")",
";",
"}"
] | In place shuffle of an ndarray
along a specified set of dimensions
@param array the ndarray to shuffle
@param dimension the dimension to do the shuffle
@return | [
"In",
"place",
"shuffle",
"of",
"an",
"ndarray",
"along",
"a",
"specified",
"set",
"of",
"dimensions"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/JCublasNDArrayFactory.java#L993-L996 |
128,129 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/CrashReportingUtil.java | CrashReportingUtil.crashDumpOutputDirectory | public static void crashDumpOutputDirectory(File rootDir){
if(rootDir == null){
String userDir = System.getProperty("user.dir");
if(userDir == null){
userDir = "";
}
crashDumpRootDirectory = new File(userDir);
return;
}
... | java | public static void crashDumpOutputDirectory(File rootDir){
if(rootDir == null){
String userDir = System.getProperty("user.dir");
if(userDir == null){
userDir = "";
}
crashDumpRootDirectory = new File(userDir);
return;
}
... | [
"public",
"static",
"void",
"crashDumpOutputDirectory",
"(",
"File",
"rootDir",
")",
"{",
"if",
"(",
"rootDir",
"==",
"null",
")",
"{",
"String",
"userDir",
"=",
"System",
".",
"getProperty",
"(",
"\"user.dir\"",
")",
";",
"if",
"(",
"userDir",
"==",
"null... | Method that can be use to customize the output directory for memory crash reporting. By default,
the current working directory will be used.
@param rootDir Root directory to use for crash reporting. If null is passed, the current working directory
will be used | [
"Method",
"that",
"can",
"be",
"use",
"to",
"customize",
"the",
"output",
"directory",
"for",
"memory",
"crash",
"reporting",
".",
"By",
"default",
"the",
"current",
"working",
"directory",
"will",
"be",
"used",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/CrashReportingUtil.java#L116-L126 |
128,130 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasRegularizerUtils.java | KerasRegularizerUtils.getWeightRegularizerFromConfig | public static double getWeightRegularizerFromConfig(Map<String, Object> layerConfig,
KerasLayerConfiguration conf,
String configField,
String regularize... | java | public static double getWeightRegularizerFromConfig(Map<String, Object> layerConfig,
KerasLayerConfiguration conf,
String configField,
String regularize... | [
"public",
"static",
"double",
"getWeightRegularizerFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
",",
"KerasLayerConfiguration",
"conf",
",",
"String",
"configField",
",",
"String",
"regularizerType",
")",
"throws",
"UnsupportedKerasConfigur... | Get weight regularization from Keras weight regularization configuration.
@param layerConfig Map containing Keras weight regularization configuration
@param conf Keras layer configuration
@param configField regularization config field to use
@param regularizerType type of regularization as string (e... | [
"Get",
"weight",
"regularization",
"from",
"Keras",
"weight",
"regularization",
"configuration",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasRegularizerUtils.java#L36-L63 |
128,131 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SDLayerParams.java | SDLayerParams.getParamShapes | @JsonIgnore
public Map<String, long[]> getParamShapes() {
Map<String, long[]> map = new LinkedHashMap<>();
map.putAll(weightParams);
map.putAll(biasParams);
return map;
} | java | @JsonIgnore
public Map<String, long[]> getParamShapes() {
Map<String, long[]> map = new LinkedHashMap<>();
map.putAll(weightParams);
map.putAll(biasParams);
return map;
} | [
"@",
"JsonIgnore",
"public",
"Map",
"<",
"String",
",",
"long",
"[",
"]",
">",
"getParamShapes",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"long",
"[",
"]",
">",
"map",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"map",
".",
"putAll",
"(",
... | Get the parameter shapes for all parameters
@return Map of parameter shapes, by parameter | [
"Get",
"the",
"parameter",
"shapes",
"for",
"all",
"parameters"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SDLayerParams.java#L134-L140 |
128,132 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.getConfiguration | @Override
public Configuration getConfiguration() {
try {
globalLock.readLock().lock();
return configuration;
} finally {
globalLock.readLock().unlock();
}
} | java | @Override
public Configuration getConfiguration() {
try {
globalLock.readLock().lock();
return configuration;
} finally {
globalLock.readLock().unlock();
}
} | [
"@",
"Override",
"public",
"Configuration",
"getConfiguration",
"(",
")",
"{",
"try",
"{",
"globalLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"return",
"configuration",
";",
"}",
"finally",
"{",
"globalLock",
".",
"readLock",
"(",
")",
... | Returns current Allocator configuration
@return current configuration | [
"Returns",
"current",
"Allocator",
"configuration"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L271-L279 |
128,133 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.getPointer | @Override
@Deprecated
public Pointer getPointer(DataBuffer buffer, AllocationShape shape, boolean isView, CudaContext context) {
return memoryHandler.getDevicePointer(buffer, context);
} | java | @Override
@Deprecated
public Pointer getPointer(DataBuffer buffer, AllocationShape shape, boolean isView, CudaContext context) {
return memoryHandler.getDevicePointer(buffer, context);
} | [
"@",
"Override",
"@",
"Deprecated",
"public",
"Pointer",
"getPointer",
"(",
"DataBuffer",
"buffer",
",",
"AllocationShape",
"shape",
",",
"boolean",
"isView",
",",
"CudaContext",
"context",
")",
"{",
"return",
"memoryHandler",
".",
"getDevicePointer",
"(",
"buffer... | This method returns actual device pointer valid for specified shape of current object
@param buffer
@param shape
@param isView | [
"This",
"method",
"returns",
"actual",
"device",
"pointer",
"valid",
"for",
"specified",
"shape",
"of",
"current",
"object"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L303-L307 |
128,134 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.getPointer | @Override
public Pointer getPointer(INDArray array, CudaContext context) {
// DataBuffer buffer = array.data().originalDataBuffer() == null ? array.data() : array.data().originalDataBuffer();
if (array.isEmpty())
return null;
return memoryHandler.getDevicePointer(array.data()... | java | @Override
public Pointer getPointer(INDArray array, CudaContext context) {
// DataBuffer buffer = array.data().originalDataBuffer() == null ? array.data() : array.data().originalDataBuffer();
if (array.isEmpty())
return null;
return memoryHandler.getDevicePointer(array.data()... | [
"@",
"Override",
"public",
"Pointer",
"getPointer",
"(",
"INDArray",
"array",
",",
"CudaContext",
"context",
")",
"{",
"// DataBuffer buffer = array.data().originalDataBuffer() == null ? array.data() : array.data().originalDataBuffer();",
"if",
"(",
"array",
".",
"isEmpty",
... | This method returns actual device pointer valid for specified INDArray
@param array | [
"This",
"method",
"returns",
"actual",
"device",
"pointer",
"valid",
"for",
"specified",
"INDArray"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L314-L321 |
128,135 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.getHostPointer | @Override
public Pointer getHostPointer(INDArray array) {
if (array.isEmpty())
return null;
synchronizeHostData(array);
return memoryHandler.getHostPointer(array.data());
} | java | @Override
public Pointer getHostPointer(INDArray array) {
if (array.isEmpty())
return null;
synchronizeHostData(array);
return memoryHandler.getHostPointer(array.data());
} | [
"@",
"Override",
"public",
"Pointer",
"getHostPointer",
"(",
"INDArray",
"array",
")",
"{",
"if",
"(",
"array",
".",
"isEmpty",
"(",
")",
")",
"return",
"null",
";",
"synchronizeHostData",
"(",
"array",
")",
";",
"return",
"memoryHandler",
".",
"getHostPoint... | This method returns actual host pointer valid for current object
@param array | [
"This",
"method",
"returns",
"actual",
"host",
"pointer",
"valid",
"for",
"current",
"object"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L328-L335 |
128,136 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.freeMemory | public void freeMemory(AllocationPoint point) {
if (point.getAllocationStatus() == AllocationStatus.DEVICE) {
this.getMemoryHandler().getMemoryProvider().free(point);
point.setAllocationStatus(AllocationStatus.HOST);
this.getMemoryHandler().getMemoryProvider().free(point);
... | java | public void freeMemory(AllocationPoint point) {
if (point.getAllocationStatus() == AllocationStatus.DEVICE) {
this.getMemoryHandler().getMemoryProvider().free(point);
point.setAllocationStatus(AllocationStatus.HOST);
this.getMemoryHandler().getMemoryProvider().free(point);
... | [
"public",
"void",
"freeMemory",
"(",
"AllocationPoint",
"point",
")",
"{",
"if",
"(",
"point",
".",
"getAllocationStatus",
"(",
")",
"==",
"AllocationStatus",
".",
"DEVICE",
")",
"{",
"this",
".",
"getMemoryHandler",
"(",
")",
".",
"getMemoryProvider",
"(",
... | This method releases memory allocated for this allocation point
@param point | [
"This",
"method",
"releases",
"memory",
"allocated",
"for",
"this",
"allocation",
"point"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L402-L415 |
128,137 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.allocateMemory | @Override
public AllocationPoint allocateMemory(DataBuffer buffer, AllocationShape requiredMemory, boolean initialize) {
// by default we allocate on initial location
AllocationPoint point = null;
if (configuration.getMemoryModel() == Configuration.MemoryModel.IMMEDIATE) {
point... | java | @Override
public AllocationPoint allocateMemory(DataBuffer buffer, AllocationShape requiredMemory, boolean initialize) {
// by default we allocate on initial location
AllocationPoint point = null;
if (configuration.getMemoryModel() == Configuration.MemoryModel.IMMEDIATE) {
point... | [
"@",
"Override",
"public",
"AllocationPoint",
"allocateMemory",
"(",
"DataBuffer",
"buffer",
",",
"AllocationShape",
"requiredMemory",
",",
"boolean",
"initialize",
")",
"{",
"// by default we allocate on initial location",
"AllocationPoint",
"point",
"=",
"null",
";",
"i... | This method allocates required chunk of memory
@param requiredMemory | [
"This",
"method",
"allocates",
"required",
"chunk",
"of",
"memory"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L422-L435 |
128,138 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.seekUnusedZero | protected synchronized long seekUnusedZero(Long bucketId, Aggressiveness aggressiveness) {
AtomicLong freeSpace = new AtomicLong(0);
int totalElements = (int) memoryHandler.getAllocatedHostObjects(bucketId);
// these 2 variables will contain jvm-wise memory access frequencies
float sho... | java | protected synchronized long seekUnusedZero(Long bucketId, Aggressiveness aggressiveness) {
AtomicLong freeSpace = new AtomicLong(0);
int totalElements = (int) memoryHandler.getAllocatedHostObjects(bucketId);
// these 2 variables will contain jvm-wise memory access frequencies
float sho... | [
"protected",
"synchronized",
"long",
"seekUnusedZero",
"(",
"Long",
"bucketId",
",",
"Aggressiveness",
"aggressiveness",
")",
"{",
"AtomicLong",
"freeSpace",
"=",
"new",
"AtomicLong",
"(",
"0",
")",
";",
"int",
"totalElements",
"=",
"(",
"int",
")",
"memoryHandl... | This method seeks for unused zero-copy memory allocations
@param bucketId Id of the bucket, serving allocations
@return size of memory that was deallocated | [
"This",
"method",
"seeks",
"for",
"unused",
"zero",
"-",
"copy",
"memory",
"allocations"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L563-L619 |
128,139 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.seekUnusedDevice | protected long seekUnusedDevice(Long threadId, Integer deviceId, Aggressiveness aggressiveness) {
AtomicLong freeSpace = new AtomicLong(0);
// int initialSize = allocations.size();
// these 2 variables will contain jvm-wise memory access frequencies
float shortAverage = deviceShort.g... | java | protected long seekUnusedDevice(Long threadId, Integer deviceId, Aggressiveness aggressiveness) {
AtomicLong freeSpace = new AtomicLong(0);
// int initialSize = allocations.size();
// these 2 variables will contain jvm-wise memory access frequencies
float shortAverage = deviceShort.g... | [
"protected",
"long",
"seekUnusedDevice",
"(",
"Long",
"threadId",
",",
"Integer",
"deviceId",
",",
"Aggressiveness",
"aggressiveness",
")",
"{",
"AtomicLong",
"freeSpace",
"=",
"new",
"AtomicLong",
"(",
"0",
")",
";",
"// int initialSize = allocations.size();",
"// t... | This method seeks for unused device memory allocations, for specified thread and device
@param threadId Id of the thread, retrieved via Thread.currentThread().getId()
@param deviceId Id of the device
@return size of memory that was deallocated | [
"This",
"method",
"seeks",
"for",
"unused",
"device",
"memory",
"allocations",
"for",
"specified",
"thread",
"and",
"device"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L628-L701 |
128,140 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.memcpyAsync | @Override
public void memcpyAsync(DataBuffer dstBuffer, Pointer srcPointer, long length, long dstOffset) {
// if (dstBuffer.isConstant()) {
// this.memoryHandler.memcpySpecial(dstBuffer, srcPointer, length, dstOffset);
// } else
this.memoryHandler.memcpyAsync... | java | @Override
public void memcpyAsync(DataBuffer dstBuffer, Pointer srcPointer, long length, long dstOffset) {
// if (dstBuffer.isConstant()) {
// this.memoryHandler.memcpySpecial(dstBuffer, srcPointer, length, dstOffset);
// } else
this.memoryHandler.memcpyAsync... | [
"@",
"Override",
"public",
"void",
"memcpyAsync",
"(",
"DataBuffer",
"dstBuffer",
",",
"Pointer",
"srcPointer",
",",
"long",
"length",
",",
"long",
"dstOffset",
")",
"{",
"// if (dstBuffer.isConstant()) {",
"// this.memoryHandler.memcpySpecial(dstBuffer, src... | This method implements asynchronous memcpy, if that's available on current hardware
@param dstBuffer
@param srcPointer
@param length
@param dstOffset | [
"This",
"method",
"implements",
"asynchronous",
"memcpy",
"if",
"that",
"s",
"available",
"on",
"current",
"hardware"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L949-L955 |
128,141 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.memcpy | @Override
public void memcpy(DataBuffer dstBuffer, DataBuffer srcBuffer) {
this.memoryHandler.memcpy(dstBuffer, srcBuffer);
} | java | @Override
public void memcpy(DataBuffer dstBuffer, DataBuffer srcBuffer) {
this.memoryHandler.memcpy(dstBuffer, srcBuffer);
} | [
"@",
"Override",
"public",
"void",
"memcpy",
"(",
"DataBuffer",
"dstBuffer",
",",
"DataBuffer",
"srcBuffer",
")",
"{",
"this",
".",
"memoryHandler",
".",
"memcpy",
"(",
"dstBuffer",
",",
"srcBuffer",
")",
";",
"}"
] | This method implements blocking memcpy
@param dstBuffer
@param srcBuffer | [
"This",
"method",
"implements",
"blocking",
"memcpy"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L987-L990 |
128,142 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/sequence/Sequence.java | Sequence.asLabels | public List<String> asLabels() {
List<String> labels = new ArrayList<>();
for (T element : getElements()) {
labels.add(element.getLabel());
}
return labels;
} | java | public List<String> asLabels() {
List<String> labels = new ArrayList<>();
for (T element : getElements()) {
labels.add(element.getLabel());
}
return labels;
} | [
"public",
"List",
"<",
"String",
">",
"asLabels",
"(",
")",
"{",
"List",
"<",
"String",
">",
"labels",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"T",
"element",
":",
"getElements",
"(",
")",
")",
"{",
"labels",
".",
"add",
"(",
"e... | Returns this sequence as list of labels
@return | [
"Returns",
"this",
"sequence",
"as",
"list",
"of",
"labels"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/sequence/Sequence.java#L96-L102 |
128,143 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp/src/main/java/org/deeplearning4j/spark/text/functions/UpdateWordFreqAccumulatorFunction.java | UpdateWordFreqAccumulatorFunction.call | @Override
public Pair<List<String>, AtomicLong> call(List<String> lstOfWords) throws Exception {
List<String> stops = stopWords.getValue();
Counter<String> counter = new Counter<>();
for (String w : lstOfWords) {
if (w.isEmpty())
continue;
if (!stops... | java | @Override
public Pair<List<String>, AtomicLong> call(List<String> lstOfWords) throws Exception {
List<String> stops = stopWords.getValue();
Counter<String> counter = new Counter<>();
for (String w : lstOfWords) {
if (w.isEmpty())
continue;
if (!stops... | [
"@",
"Override",
"public",
"Pair",
"<",
"List",
"<",
"String",
">",
",",
"AtomicLong",
">",
"call",
"(",
"List",
"<",
"String",
">",
"lstOfWords",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"stops",
"=",
"stopWords",
".",
"getValue",
... | Function to add to word freq counter and total count of words | [
"Function",
"to",
"add",
"to",
"word",
"freq",
"counter",
"and",
"total",
"count",
"of",
"words"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp/src/main/java/org/deeplearning4j/spark/text/functions/UpdateWordFreqAccumulatorFunction.java#L43-L65 |
128,144 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/paramavg/ParameterAveragingTrainingMaster.java | ParameterAveragingTrainingMaster.addHook | @Override
public void addHook(TrainingHook trainingHook) {
if (trainingHookList == null) {
trainingHookList = new ArrayList<>();
}
trainingHookList.add(trainingHook);
} | java | @Override
public void addHook(TrainingHook trainingHook) {
if (trainingHookList == null) {
trainingHookList = new ArrayList<>();
}
trainingHookList.add(trainingHook);
} | [
"@",
"Override",
"public",
"void",
"addHook",
"(",
"TrainingHook",
"trainingHook",
")",
"{",
"if",
"(",
"trainingHookList",
"==",
"null",
")",
"{",
"trainingHookList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"trainingHookList",
".",
"add",
"(",
... | Add a hook for the master for pre and post training
@param trainingHook the training hook to add | [
"Add",
"a",
"hook",
"for",
"the",
"master",
"for",
"pre",
"and",
"post",
"training"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/paramavg/ParameterAveragingTrainingMaster.java#L219-L225 |
128,145 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/graphmapper/onnx/OnnxGraphMapper.java | OnnxGraphMapper.nd4jTypeFromOnnxType | public DataType nd4jTypeFromOnnxType(OnnxProto3.TensorProto.DataType dataType) {
switch (dataType) {
case DOUBLE: return DataType.DOUBLE;
case FLOAT: return DataType.FLOAT;
case FLOAT16: return DataType.HALF;
case INT32:
case INT64: return DataType.INT... | java | public DataType nd4jTypeFromOnnxType(OnnxProto3.TensorProto.DataType dataType) {
switch (dataType) {
case DOUBLE: return DataType.DOUBLE;
case FLOAT: return DataType.FLOAT;
case FLOAT16: return DataType.HALF;
case INT32:
case INT64: return DataType.INT... | [
"public",
"DataType",
"nd4jTypeFromOnnxType",
"(",
"OnnxProto3",
".",
"TensorProto",
".",
"DataType",
"dataType",
")",
"{",
"switch",
"(",
"dataType",
")",
"{",
"case",
"DOUBLE",
":",
"return",
"DataType",
".",
"DOUBLE",
";",
"case",
"FLOAT",
":",
"return",
... | Convert an onnx type to the proper nd4j type
@param dataType the data type to convert
@return the nd4j type for the onnx type | [
"Convert",
"an",
"onnx",
"type",
"to",
"the",
"proper",
"nd4j",
"type"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/graphmapper/onnx/OnnxGraphMapper.java#L443-L452 |
128,146 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.toClassifierPrediction | public static double toClassifierPrediction(Vector vector) {
double max = Double.NEGATIVE_INFINITY;
int maxIndex = 0;
for (int i = 0; i < vector.size(); i++) {
double curr = vector.apply(i);
if (curr > max) {
maxIndex = i;
max = curr;
... | java | public static double toClassifierPrediction(Vector vector) {
double max = Double.NEGATIVE_INFINITY;
int maxIndex = 0;
for (int i = 0; i < vector.size(); i++) {
double curr = vector.apply(i);
if (curr > max) {
maxIndex = i;
max = curr;
... | [
"public",
"static",
"double",
"toClassifierPrediction",
"(",
"Vector",
"vector",
")",
"{",
"double",
"max",
"=",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"int",
"maxIndex",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vector",
".",
... | This is for the edge case where
you have a single output layer
and need to convert the output layer to
an index
@param vector the vector to get the classifier prediction for
@return the prediction for the given vector | [
"This",
"is",
"for",
"the",
"edge",
"case",
"where",
"you",
"have",
"a",
"single",
"output",
"layer",
"and",
"need",
"to",
"convert",
"the",
"output",
"layer",
"to",
"an",
"index"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L61-L73 |
128,147 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.pointOf | public static LabeledPoint pointOf(Collection<Writable> writables) {
double[] ret = new double[writables.size() - 1];
int count = 0;
double target = 0;
for (Writable w : writables) {
if (count < writables.size() - 1)
ret[count++] = Float.parseFloat(w.toString(... | java | public static LabeledPoint pointOf(Collection<Writable> writables) {
double[] ret = new double[writables.size() - 1];
int count = 0;
double target = 0;
for (Writable w : writables) {
if (count < writables.size() - 1)
ret[count++] = Float.parseFloat(w.toString(... | [
"public",
"static",
"LabeledPoint",
"pointOf",
"(",
"Collection",
"<",
"Writable",
">",
"writables",
")",
"{",
"double",
"[",
"]",
"ret",
"=",
"new",
"double",
"[",
"writables",
".",
"size",
"(",
")",
"-",
"1",
"]",
";",
"int",
"count",
"=",
"0",
";"... | Returns a labeled point of the writables
where the final item is the point and the rest of the items are
features
@param writables the writables
@return the labeled point | [
"Returns",
"a",
"labeled",
"point",
"of",
"the",
"writables",
"where",
"the",
"final",
"item",
"is",
"the",
"point",
"and",
"the",
"rest",
"of",
"the",
"items",
"are",
"features"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L185-L199 |
128,148 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.fromLabeledPoint | public static JavaRDD<DataSet> fromLabeledPoint(JavaRDD<LabeledPoint> data, final long numPossibleLabels,
long batchSize) {
JavaRDD<DataSet> mappedData = data.map(new Function<LabeledPoint, DataSet>() {
@Override
public DataSet call(LabeledPoint lp) {
... | java | public static JavaRDD<DataSet> fromLabeledPoint(JavaRDD<LabeledPoint> data, final long numPossibleLabels,
long batchSize) {
JavaRDD<DataSet> mappedData = data.map(new Function<LabeledPoint, DataSet>() {
@Override
public DataSet call(LabeledPoint lp) {
... | [
"public",
"static",
"JavaRDD",
"<",
"DataSet",
">",
"fromLabeledPoint",
"(",
"JavaRDD",
"<",
"LabeledPoint",
">",
"data",
",",
"final",
"long",
"numPossibleLabels",
",",
"long",
"batchSize",
")",
"{",
"JavaRDD",
"<",
"DataSet",
">",
"mappedData",
"=",
"data",
... | Convert an rdd
of labeled point
based on the specified batch size
in to data set
@param data the data to convert
@param numPossibleLabels the number of possible labels
@param batchSize the batch size
@return the new rdd | [
"Convert",
"an",
"rdd",
"of",
"labeled",
"point",
"based",
"on",
"the",
"specified",
"batch",
"size",
"in",
"to",
"data",
"set"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L211-L222 |
128,149 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.fromLabeledPoint | @Deprecated
public static JavaRDD<DataSet> fromLabeledPoint(JavaSparkContext sc, JavaRDD<LabeledPoint> data,
final long numPossibleLabels) {
return data.map(new Function<LabeledPoint, DataSet>() {
@Override
public DataSet call(LabeledPoint lp) {
re... | java | @Deprecated
public static JavaRDD<DataSet> fromLabeledPoint(JavaSparkContext sc, JavaRDD<LabeledPoint> data,
final long numPossibleLabels) {
return data.map(new Function<LabeledPoint, DataSet>() {
@Override
public DataSet call(LabeledPoint lp) {
re... | [
"@",
"Deprecated",
"public",
"static",
"JavaRDD",
"<",
"DataSet",
">",
"fromLabeledPoint",
"(",
"JavaSparkContext",
"sc",
",",
"JavaRDD",
"<",
"LabeledPoint",
">",
"data",
",",
"final",
"long",
"numPossibleLabels",
")",
"{",
"return",
"data",
".",
"map",
"(",
... | From labeled point
@param sc the org.deeplearning4j.spark context used for creating the rdd
@param data the data to convert
@param numPossibleLabels the number of possible labels
@return
@deprecated Use {@link #fromLabeledPoint(JavaRDD, int)} | [
"From",
"labeled",
"point"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L232-L241 |
128,150 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.fromContinuousLabeledPoint | @Deprecated
public static JavaRDD<DataSet> fromContinuousLabeledPoint(JavaSparkContext sc, JavaRDD<LabeledPoint> data) {
return data.map(new Function<LabeledPoint, DataSet>() {
@Override
public DataSet call(LabeledPoint lp) {
return convertToDataset(lp);
... | java | @Deprecated
public static JavaRDD<DataSet> fromContinuousLabeledPoint(JavaSparkContext sc, JavaRDD<LabeledPoint> data) {
return data.map(new Function<LabeledPoint, DataSet>() {
@Override
public DataSet call(LabeledPoint lp) {
return convertToDataset(lp);
... | [
"@",
"Deprecated",
"public",
"static",
"JavaRDD",
"<",
"DataSet",
">",
"fromContinuousLabeledPoint",
"(",
"JavaSparkContext",
"sc",
",",
"JavaRDD",
"<",
"LabeledPoint",
">",
"data",
")",
"{",
"return",
"data",
".",
"map",
"(",
"new",
"Function",
"<",
"LabeledP... | Convert rdd labeled points to a rdd dataset with continuous features
@param data the java rdd labeled points ready to convert
@return a JavaRDD<Dataset> with a continuous label
@deprecated Use {@link #fromContinuousLabeledPoint(JavaRDD)} | [
"Convert",
"rdd",
"labeled",
"points",
"to",
"a",
"rdd",
"dataset",
"with",
"continuous",
"features"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L249-L258 |
128,151 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.toLabeledPoint | private static List<LabeledPoint> toLabeledPoint(List<DataSet> labeledPoints) {
List<LabeledPoint> ret = new ArrayList<>();
for (DataSet point : labeledPoints) {
ret.add(toLabeledPoint(point));
}
return ret;
} | java | private static List<LabeledPoint> toLabeledPoint(List<DataSet> labeledPoints) {
List<LabeledPoint> ret = new ArrayList<>();
for (DataSet point : labeledPoints) {
ret.add(toLabeledPoint(point));
}
return ret;
} | [
"private",
"static",
"List",
"<",
"LabeledPoint",
">",
"toLabeledPoint",
"(",
"List",
"<",
"DataSet",
">",
"labeledPoints",
")",
"{",
"List",
"<",
"LabeledPoint",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"DataSet",
"point",
"... | Convert a list of dataset in to a list of labeled points
@param labeledPoints the labeled points to convert
@return the labeled point list | [
"Convert",
"a",
"list",
"of",
"dataset",
"in",
"to",
"a",
"list",
"of",
"labeled",
"points"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L290-L296 |
128,152 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.fromContinuousLabeledPoint | public static JavaRDD<DataSet> fromContinuousLabeledPoint(JavaRDD<LabeledPoint> data, boolean preCache) {
if (preCache && !data.getStorageLevel().useMemory()) {
data.cache();
}
return data.map(new Function<LabeledPoint, DataSet>() {
@Override
public DataSet ca... | java | public static JavaRDD<DataSet> fromContinuousLabeledPoint(JavaRDD<LabeledPoint> data, boolean preCache) {
if (preCache && !data.getStorageLevel().useMemory()) {
data.cache();
}
return data.map(new Function<LabeledPoint, DataSet>() {
@Override
public DataSet ca... | [
"public",
"static",
"JavaRDD",
"<",
"DataSet",
">",
"fromContinuousLabeledPoint",
"(",
"JavaRDD",
"<",
"LabeledPoint",
">",
"data",
",",
"boolean",
"preCache",
")",
"{",
"if",
"(",
"preCache",
"&&",
"!",
"data",
".",
"getStorageLevel",
"(",
")",
".",
"useMem... | Converts a continuous JavaRDD LabeledPoint to a JavaRDD DataSet.
@param data JavaRdd LabeledPoint
@param preCache boolean pre-cache rdd before operation
@return | [
"Converts",
"a",
"continuous",
"JavaRDD",
"LabeledPoint",
"to",
"a",
"JavaRDD",
"DataSet",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L329-L339 |
128,153 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.fromLabeledPoint | public static JavaRDD<DataSet> fromLabeledPoint(JavaRDD<LabeledPoint> data, final long numPossibleLabels) {
return fromLabeledPoint(data, numPossibleLabels, false);
} | java | public static JavaRDD<DataSet> fromLabeledPoint(JavaRDD<LabeledPoint> data, final long numPossibleLabels) {
return fromLabeledPoint(data, numPossibleLabels, false);
} | [
"public",
"static",
"JavaRDD",
"<",
"DataSet",
">",
"fromLabeledPoint",
"(",
"JavaRDD",
"<",
"LabeledPoint",
">",
"data",
",",
"final",
"long",
"numPossibleLabels",
")",
"{",
"return",
"fromLabeledPoint",
"(",
"data",
",",
"numPossibleLabels",
",",
"false",
")",... | Converts JavaRDD labeled points to JavaRDD datasets.
@param data JavaRDD LabeledPoints
@param numPossibleLabels number of possible labels
@return | [
"Converts",
"JavaRDD",
"labeled",
"points",
"to",
"JavaRDD",
"datasets",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L347-L349 |
128,154 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.fromLabeledPoint | public static JavaRDD<DataSet> fromLabeledPoint(JavaRDD<LabeledPoint> data, final long numPossibleLabels,
boolean preCache) {
if (preCache && !data.getStorageLevel().useMemory()) {
data.cache();
}
return data.map(new Function<LabeledPoint, DataSet>() {
... | java | public static JavaRDD<DataSet> fromLabeledPoint(JavaRDD<LabeledPoint> data, final long numPossibleLabels,
boolean preCache) {
if (preCache && !data.getStorageLevel().useMemory()) {
data.cache();
}
return data.map(new Function<LabeledPoint, DataSet>() {
... | [
"public",
"static",
"JavaRDD",
"<",
"DataSet",
">",
"fromLabeledPoint",
"(",
"JavaRDD",
"<",
"LabeledPoint",
">",
"data",
",",
"final",
"long",
"numPossibleLabels",
",",
"boolean",
"preCache",
")",
"{",
"if",
"(",
"preCache",
"&&",
"!",
"data",
".",
"getStor... | Converts JavaRDD labeled points to JavaRDD DataSets.
@param data JavaRDD LabeledPoints
@param numPossibleLabels number of possible labels
@param preCache boolean pre-cache rdd before operation
@return | [
"Converts",
"JavaRDD",
"labeled",
"points",
"to",
"JavaRDD",
"DataSets",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L358-L369 |
128,155 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.fromDataSet | public static JavaRDD<LabeledPoint> fromDataSet(JavaRDD<DataSet> data, boolean preCache) {
if (preCache && !data.getStorageLevel().useMemory()) {
data.cache();
}
return data.map(new Function<DataSet, LabeledPoint>() {
@Override
public LabeledPoint call(DataSet... | java | public static JavaRDD<LabeledPoint> fromDataSet(JavaRDD<DataSet> data, boolean preCache) {
if (preCache && !data.getStorageLevel().useMemory()) {
data.cache();
}
return data.map(new Function<DataSet, LabeledPoint>() {
@Override
public LabeledPoint call(DataSet... | [
"public",
"static",
"JavaRDD",
"<",
"LabeledPoint",
">",
"fromDataSet",
"(",
"JavaRDD",
"<",
"DataSet",
">",
"data",
",",
"boolean",
"preCache",
")",
"{",
"if",
"(",
"preCache",
"&&",
"!",
"data",
".",
"getStorageLevel",
"(",
")",
".",
"useMemory",
"(",
... | Convert an rdd of data set in to labeled point.
@param data the dataset to convert
@param preCache boolean pre-cache rdd before operation
@return an rdd of labeled point | [
"Convert",
"an",
"rdd",
"of",
"data",
"set",
"in",
"to",
"labeled",
"point",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L386-L396 |
128,156 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java | Dl4jReflection.getEmptyConstructor | public static Constructor<?> getEmptyConstructor(Class<?> clazz) {
Constructor<?> c = clazz.getDeclaredConstructors()[0];
for (int i = 0; i < clazz.getDeclaredConstructors().length; i++) {
if (clazz.getDeclaredConstructors()[i].getParameterTypes().length < 1) {
c = clazz.getD... | java | public static Constructor<?> getEmptyConstructor(Class<?> clazz) {
Constructor<?> c = clazz.getDeclaredConstructors()[0];
for (int i = 0; i < clazz.getDeclaredConstructors().length; i++) {
if (clazz.getDeclaredConstructors()[i].getParameterTypes().length < 1) {
c = clazz.getD... | [
"public",
"static",
"Constructor",
"<",
"?",
">",
"getEmptyConstructor",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Constructor",
"<",
"?",
">",
"c",
"=",
"clazz",
".",
"getDeclaredConstructors",
"(",
")",
"[",
"0",
"]",
";",
"for",
"(",
"int",
... | Gets the empty constructor from a class
@param clazz the class to get the constructor from
@return the empty constructor for the class | [
"Gets",
"the",
"empty",
"constructor",
"from",
"a",
"class"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java#L39-L49 |
128,157 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java | Dl4jReflection.setProperties | public static void setProperties(Object obj, Properties props) throws Exception {
for (Field field : obj.getClass().getDeclaredFields()) {
field.setAccessible(true);
if (props.containsKey(field.getName())) {
set(field, obj, props.getProperty(field.getName()));
... | java | public static void setProperties(Object obj, Properties props) throws Exception {
for (Field field : obj.getClass().getDeclaredFields()) {
field.setAccessible(true);
if (props.containsKey(field.getName())) {
set(field, obj, props.getProperty(field.getName()));
... | [
"public",
"static",
"void",
"setProperties",
"(",
"Object",
"obj",
",",
"Properties",
"props",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Field",
"field",
":",
"obj",
".",
"getClass",
"(",
")",
".",
"getDeclaredFields",
"(",
")",
")",
"{",
"field",
".... | Sets the properties of the given object
@param obj the object o set
@param props the properties to set | [
"Sets",
"the",
"properties",
"of",
"the",
"given",
"object"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java#L70-L78 |
128,158 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java | Dl4jReflection.getFieldsAsProperties | public static Properties getFieldsAsProperties(Object obj, Class<?>[] clazzes) throws Exception {
Properties props = new Properties();
for (Field field : obj.getClass().getDeclaredFields()) {
if (Modifier.isStatic(field.getModifiers()))
continue;
field.setAccessib... | java | public static Properties getFieldsAsProperties(Object obj, Class<?>[] clazzes) throws Exception {
Properties props = new Properties();
for (Field field : obj.getClass().getDeclaredFields()) {
if (Modifier.isStatic(field.getModifiers()))
continue;
field.setAccessib... | [
"public",
"static",
"Properties",
"getFieldsAsProperties",
"(",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"clazzes",
")",
"throws",
"Exception",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"Field",
"field"... | Get fields as properties
@param obj the object to get fields for
@param clazzes the classes to use for reflection and properties.
T
@return the fields as properties | [
"Get",
"fields",
"as",
"properties"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java#L106-L122 |
128,159 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/impl/CudaDirectProvider.java | CudaDirectProvider.pingDeviceForFreeMemory | public boolean pingDeviceForFreeMemory(Integer deviceId, long requiredMemory) {
/*
long[] totalMem = new long[1];
long[] freeMem = new long[1];
JCuda.cudaMemGetInfo(freeMem, totalMem);
long free = freeMem[0];
long total = totalMem[0];
lo... | java | public boolean pingDeviceForFreeMemory(Integer deviceId, long requiredMemory) {
/*
long[] totalMem = new long[1];
long[] freeMem = new long[1];
JCuda.cudaMemGetInfo(freeMem, totalMem);
long free = freeMem[0];
long total = totalMem[0];
lo... | [
"public",
"boolean",
"pingDeviceForFreeMemory",
"(",
"Integer",
"deviceId",
",",
"long",
"requiredMemory",
")",
"{",
"/*\n long[] totalMem = new long[1];\n long[] freeMem = new long[1];\n \n \n JCuda.cudaMemGetInfo(freeMem, totalMem);\n \n long ... | This method checks specified device for specified amount of memory
@param deviceId
@param requiredMemory
@return | [
"This",
"method",
"checks",
"specified",
"device",
"for",
"specified",
"amount",
"of",
"memory"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/impl/CudaDirectProvider.java#L189-L216 |
128,160 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/inmemory/InMemoryLookupTable.java | InMemoryLookupTable.plotVocab | @Override
public void plotVocab(BarnesHutTsne tsne, int numWords, UiConnectionInfo connectionInfo) {
try {
final List<String> labels = fitTnseAndGetLabels(tsne, numWords);
final INDArray reducedData = tsne.getData();
StringBuilder sb = new StringBuilder();
for... | java | @Override
public void plotVocab(BarnesHutTsne tsne, int numWords, UiConnectionInfo connectionInfo) {
try {
final List<String> labels = fitTnseAndGetLabels(tsne, numWords);
final INDArray reducedData = tsne.getData();
StringBuilder sb = new StringBuilder();
for... | [
"@",
"Override",
"public",
"void",
"plotVocab",
"(",
"BarnesHutTsne",
"tsne",
",",
"int",
"numWords",
",",
"UiConnectionInfo",
"connectionInfo",
")",
"{",
"try",
"{",
"final",
"List",
"<",
"String",
">",
"labels",
"=",
"fitTnseAndGetLabels",
"(",
"tsne",
",",
... | Render the words via TSNE
@param tsne the tsne to use
@param numWords
@param connectionInfo | [
"Render",
"the",
"words",
"via",
"TSNE"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/inmemory/InMemoryLookupTable.java#L204-L270 |
128,161 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/inmemory/InMemoryLookupTable.java | InMemoryLookupTable.putVector | @Override
public void putVector(String word, INDArray vector) {
if (word == null)
throw new IllegalArgumentException("No null words allowed");
if (vector == null)
throw new IllegalArgumentException("No null vectors allowed");
int idx = vocab.indexOf(word);
syn... | java | @Override
public void putVector(String word, INDArray vector) {
if (word == null)
throw new IllegalArgumentException("No null words allowed");
if (vector == null)
throw new IllegalArgumentException("No null vectors allowed");
int idx = vocab.indexOf(word);
syn... | [
"@",
"Override",
"public",
"void",
"putVector",
"(",
"String",
"word",
",",
"INDArray",
"vector",
")",
"{",
"if",
"(",
"word",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"No null words allowed\"",
")",
";",
"if",
"(",
"vector",
"==... | Inserts a word vector
@param word the word to insert
@param vector the vector to insert | [
"Inserts",
"a",
"word",
"vector"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/inmemory/InMemoryLookupTable.java#L496-L505 |
128,162 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/inmemory/InMemoryLookupTable.java | InMemoryLookupTable.consume | public void consume(InMemoryLookupTable<T> srcTable) {
if (srcTable.vectorLength != this.vectorLength)
throw new IllegalStateException("You can't consume lookupTable with different vector lengths");
if (srcTable.syn0 == null)
throw new IllegalStateException("Source lookupTable S... | java | public void consume(InMemoryLookupTable<T> srcTable) {
if (srcTable.vectorLength != this.vectorLength)
throw new IllegalStateException("You can't consume lookupTable with different vector lengths");
if (srcTable.syn0 == null)
throw new IllegalStateException("Source lookupTable S... | [
"public",
"void",
"consume",
"(",
"InMemoryLookupTable",
"<",
"T",
">",
"srcTable",
")",
"{",
"if",
"(",
"srcTable",
".",
"vectorLength",
"!=",
"this",
".",
"vectorLength",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"You can't consume lookupTable with diff... | This method consumes weights of a given InMemoryLookupTable
PLEASE NOTE: this method explicitly resets current weights
@param srcTable | [
"This",
"method",
"consumes",
"weights",
"of",
"a",
"given",
"InMemoryLookupTable"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/inmemory/InMemoryLookupTable.java#L723-L755 |
128,163 | deeplearning4j/deeplearning4j | arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/generator/genetic/crossover/TwoParentsCrossoverOperator.java | TwoParentsCrossoverOperator.initializeInstance | @Override
public void initializeInstance(PopulationModel populationModel) {
super.initializeInstance(populationModel);
parentSelection.initializeInstance(populationModel.getPopulation());
} | java | @Override
public void initializeInstance(PopulationModel populationModel) {
super.initializeInstance(populationModel);
parentSelection.initializeInstance(populationModel.getPopulation());
} | [
"@",
"Override",
"public",
"void",
"initializeInstance",
"(",
"PopulationModel",
"populationModel",
")",
"{",
"super",
".",
"initializeInstance",
"(",
"populationModel",
")",
";",
"parentSelection",
".",
"initializeInstance",
"(",
"populationModel",
".",
"getPopulation"... | Will be called by the selection operator once the population model is instantiated. | [
"Will",
"be",
"called",
"by",
"the",
"selection",
"operator",
"once",
"the",
"population",
"model",
"is",
"instantiated",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/generator/genetic/crossover/TwoParentsCrossoverOperator.java#L38-L42 |
128,164 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/dsp/LinearInterpolation.java | LinearInterpolation.interpolate | public short[] interpolate(int oldSampleRate, int newSampleRate, short[] samples) {
if (oldSampleRate == newSampleRate) {
return samples;
}
int newLength = Math.round(((float) samples.length / oldSampleRate * newSampleRate));
float lengthMultiplier = (float) newLength / sam... | java | public short[] interpolate(int oldSampleRate, int newSampleRate, short[] samples) {
if (oldSampleRate == newSampleRate) {
return samples;
}
int newLength = Math.round(((float) samples.length / oldSampleRate * newSampleRate));
float lengthMultiplier = (float) newLength / sam... | [
"public",
"short",
"[",
"]",
"interpolate",
"(",
"int",
"oldSampleRate",
",",
"int",
"newSampleRate",
",",
"short",
"[",
"]",
"samples",
")",
"{",
"if",
"(",
"oldSampleRate",
"==",
"newSampleRate",
")",
"{",
"return",
"samples",
";",
"}",
"int",
"newLength... | Do interpolation on the samples according to the original and destinated sample rates
@param oldSampleRate sample rate of the original samples
@param newSampleRate sample rate of the interpolated samples
@param samples original samples
@return interpolated samples | [
"Do",
"interpolation",
"on",
"the",
"samples",
"according",
"to",
"the",
"original",
"and",
"destinated",
"sample",
"rates"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/dsp/LinearInterpolation.java#L38-L66 |
128,165 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/util/SetUtils.java | SetUtils.intersection | public static <T> Set<T> intersection(Collection<T> parentCollection, Collection<T> removeFromCollection) {
Set<T> results = new HashSet<>(parentCollection);
results.retainAll(removeFromCollection);
return results;
} | java | public static <T> Set<T> intersection(Collection<T> parentCollection, Collection<T> removeFromCollection) {
Set<T> results = new HashSet<>(parentCollection);
results.retainAll(removeFromCollection);
return results;
} | [
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"intersection",
"(",
"Collection",
"<",
"T",
">",
"parentCollection",
",",
"Collection",
"<",
"T",
">",
"removeFromCollection",
")",
"{",
"Set",
"<",
"T",
">",
"results",
"=",
"new",
"HashSet",
"... | Set specific operations | [
"Set",
"specific",
"operations"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/util/SetUtils.java#L28-L32 |
128,166 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/util/SetUtils.java | SetUtils.difference | public static <T> Set<T> difference(Collection<? extends T> s1, Collection<? extends T> s2) {
Set<T> s3 = new HashSet<>(s1);
s3.removeAll(s2);
return s3;
} | java | public static <T> Set<T> difference(Collection<? extends T> s1, Collection<? extends T> s2) {
Set<T> s3 = new HashSet<>(s1);
s3.removeAll(s2);
return s3;
} | [
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"difference",
"(",
"Collection",
"<",
"?",
"extends",
"T",
">",
"s1",
",",
"Collection",
"<",
"?",
"extends",
"T",
">",
"s2",
")",
"{",
"Set",
"<",
"T",
">",
"s3",
"=",
"new",
"HashSet",
... | Return is s1 \ s2 | [
"Return",
"is",
"s1",
"\\",
"s2"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/util/SetUtils.java#L50-L54 |
128,167 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/SerializationUtils.java | SerializationUtils.readObject | @SuppressWarnings("unchecked")
public static <T> T readObject(InputStream is) {
try {
ObjectInputStream ois = new ObjectInputStream(is);
T ret = (T) ois.readObject();
ois.close();
return ret;
} catch (Exception e) {
throw new RuntimeExcepti... | java | @SuppressWarnings("unchecked")
public static <T> T readObject(InputStream is) {
try {
ObjectInputStream ois = new ObjectInputStream(is);
T ret = (T) ois.readObject();
ois.close();
return ret;
} catch (Exception e) {
throw new RuntimeExcepti... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"readObject",
"(",
"InputStream",
"is",
")",
"{",
"try",
"{",
"ObjectInputStream",
"ois",
"=",
"new",
"ObjectInputStream",
"(",
"is",
")",
";",
"T",
"ret",
"=",
"... | Reads an object from the given input stream
@param is the input stream to read from
@return the read object | [
"Reads",
"an",
"object",
"from",
"the",
"given",
"input",
"stream"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/SerializationUtils.java#L50-L61 |
128,168 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/SerializationUtils.java | SerializationUtils.toByteArray | public static byte[] toByteArray(Serializable toSave) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream os = new ObjectOutputStream(bos);
os.writeObject(toSave);
byte[] ret = bos.toByteArray();
os.close();
... | java | public static byte[] toByteArray(Serializable toSave) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream os = new ObjectOutputStream(bos);
os.writeObject(toSave);
byte[] ret = bos.toByteArray();
os.close();
... | [
"public",
"static",
"byte",
"[",
"]",
"toByteArray",
"(",
"Serializable",
"toSave",
")",
"{",
"try",
"{",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"os",
"=",
"new",
"ObjectOutputStream",
"(",
"bos"... | Converts the given object to a byte array
@param toSave the object to save | [
"Converts",
"the",
"given",
"object",
"to",
"a",
"byte",
"array"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/SerializationUtils.java#L69-L81 |
128,169 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/SerializationUtils.java | SerializationUtils.writeObject | public static void writeObject(Serializable toSave, OutputStream writeTo) {
try {
ObjectOutputStream os = new ObjectOutputStream(writeTo);
os.writeObject(toSave);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static void writeObject(Serializable toSave, OutputStream writeTo) {
try {
ObjectOutputStream os = new ObjectOutputStream(writeTo);
os.writeObject(toSave);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"writeObject",
"(",
"Serializable",
"toSave",
",",
"OutputStream",
"writeTo",
")",
"{",
"try",
"{",
"ObjectOutputStream",
"os",
"=",
"new",
"ObjectOutputStream",
"(",
"writeTo",
")",
";",
"os",
".",
"writeObject",
"(",
"toSave",
")"... | Writes the object to the output stream
THIS DOES NOT FLUSH THE STREAM
@param toSave the object to save
@param writeTo the output stream to write to | [
"Writes",
"the",
"object",
"to",
"the",
"output",
"stream",
"THIS",
"DOES",
"NOT",
"FLUSH",
"THE",
"STREAM"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/SerializationUtils.java#L119-L126 |
128,170 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/records/reader/impl/LineRecordReader.java | LineRecordReader.initialize | @Override
public void initialize(InputSplit split) throws IOException, InterruptedException {
super.initialize(split);
this.iter = getIterator(0);
this.initialized = true;
} | java | @Override
public void initialize(InputSplit split) throws IOException, InterruptedException {
super.initialize(split);
this.iter = getIterator(0);
this.initialized = true;
} | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"InputSplit",
"split",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"super",
".",
"initialize",
"(",
"split",
")",
";",
"this",
".",
"iter",
"=",
"getIterator",
"(",
"0",
")",
";",
"t... | Using String as StandardCharsets.UTF_8 is not serializable | [
"Using",
"String",
"as",
"StandardCharsets",
".",
"UTF_8",
"is",
"not",
"serializable"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/records/reader/impl/LineRecordReader.java#L58-L63 |
128,171 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/text/movingwindow/Util.java | Util.parallelCounterMap | public static <K, V> CounterMap<K, V> parallelCounterMap() {
CounterMap<K, V> totalWords = new CounterMap<>();
return totalWords;
} | java | public static <K, V> CounterMap<K, V> parallelCounterMap() {
CounterMap<K, V> totalWords = new CounterMap<>();
return totalWords;
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"CounterMap",
"<",
"K",
",",
"V",
">",
"parallelCounterMap",
"(",
")",
"{",
"CounterMap",
"<",
"K",
",",
"V",
">",
"totalWords",
"=",
"new",
"CounterMap",
"<>",
"(",
")",
";",
"return",
"totalWords",
";",
... | Returns a thread safe counter map
@return | [
"Returns",
"a",
"thread",
"safe",
"counter",
"map"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/text/movingwindow/Util.java#L36-L39 |
128,172 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp/src/main/java/org/deeplearning4j/spark/models/embeddings/glove/GloveChange.java | GloveChange.apply | public void apply(GloveWeightLookupTable table) {
table.getBias().putScalar(w1.getIndex(), table.getBias().getDouble(w1.getIndex()) - w1BiasUpdate);
table.getBias().putScalar(w2.getIndex(), table.getBias().getDouble(w2.getIndex()) - w2BiasUpdate);
table.getSyn0().slice(w1.getIndex()).subi(w1Upda... | java | public void apply(GloveWeightLookupTable table) {
table.getBias().putScalar(w1.getIndex(), table.getBias().getDouble(w1.getIndex()) - w1BiasUpdate);
table.getBias().putScalar(w2.getIndex(), table.getBias().getDouble(w2.getIndex()) - w2BiasUpdate);
table.getSyn0().slice(w1.getIndex()).subi(w1Upda... | [
"public",
"void",
"apply",
"(",
"GloveWeightLookupTable",
"table",
")",
"{",
"table",
".",
"getBias",
"(",
")",
".",
"putScalar",
"(",
"w1",
".",
"getIndex",
"(",
")",
",",
"table",
".",
"getBias",
"(",
")",
".",
"getDouble",
"(",
"w1",
".",
"getIndex"... | Apply the changes to the table
@param table | [
"Apply",
"the",
"changes",
"to",
"the",
"table"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp/src/main/java/org/deeplearning4j/spark/models/embeddings/glove/GloveChange.java#L56-L68 |
128,173 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/Atomic.java | Atomic.set | public void set(T value) {
try {
lock.writeLock().lock();
this.value = value;
} finally {
lock.writeLock().unlock();
}
} | java | public void set(T value) {
try {
lock.writeLock().lock();
this.value = value;
} finally {
lock.writeLock().unlock();
}
} | [
"public",
"void",
"set",
"(",
"T",
"value",
")",
"{",
"try",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"this",
".",
"value",
"=",
"value",
";",
"}",
"finally",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"unlock",
"... | This method assigns new value
@param value | [
"This",
"method",
"assigns",
"new",
"value"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/Atomic.java#L43-L51 |
128,174 | deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/Atomic.java | Atomic.cas | public boolean cas(T expected, T newValue) {
try {
lock.writeLock().lock();
if (Objects.equals(value, expected)) {
this.value = newValue;
return true;
} else
return false;
} finally {
lock.writeLock().unlock... | java | public boolean cas(T expected, T newValue) {
try {
lock.writeLock().lock();
if (Objects.equals(value, expected)) {
this.value = newValue;
return true;
} else
return false;
} finally {
lock.writeLock().unlock... | [
"public",
"boolean",
"cas",
"(",
"T",
"expected",
",",
"T",
"newValue",
")",
"{",
"try",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"if",
"(",
"Objects",
".",
"equals",
"(",
"value",
",",
"expected",
")",
")",
"{",
"this... | This method implements compare-and-swap
@param expected
@param newValue
@return true if value was swapped, false otherwise | [
"This",
"method",
"implements",
"compare",
"-",
"and",
"-",
"swap"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/Atomic.java#L76-L88 |
128,175 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/transform/BoxImageTransform.java | BoxImageTransform.doTransform | @Override
protected ImageWritable doTransform(ImageWritable image, Random random) {
if (image == null) {
return null;
}
Mat mat = converter.convert(image.getFrame());
Mat box = new Mat(height, width, mat.type());
box.put(borderValue);
x = (mat.cols() - wi... | java | @Override
protected ImageWritable doTransform(ImageWritable image, Random random) {
if (image == null) {
return null;
}
Mat mat = converter.convert(image.getFrame());
Mat box = new Mat(height, width, mat.type());
box.put(borderValue);
x = (mat.cols() - wi... | [
"@",
"Override",
"protected",
"ImageWritable",
"doTransform",
"(",
"ImageWritable",
"image",
",",
"Random",
"random",
")",
"{",
"if",
"(",
"image",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Mat",
"mat",
"=",
"converter",
".",
"convert",
"(",
"... | Takes an image and returns a boxed version of the image.
@param image to transform, null == end of stream
@param random object to use (or null for deterministic)
@return transformed image | [
"Takes",
"an",
"image",
"and",
"returns",
"a",
"boxed",
"version",
"of",
"the",
"image",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/transform/BoxImageTransform.java#L84-L117 |
128,176 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java | Convolution.pooling2D | public static INDArray pooling2D(INDArray img, int kh, int kw, int sy, int sx, int ph, int pw,
int dh, int dw, boolean isSameMode, Pooling2D.Pooling2DType type, Pooling2D.Divisor divisor,
double extra, int virtualHeight, int virtualWidth, INDArra... | java | public static INDArray pooling2D(INDArray img, int kh, int kw, int sy, int sx, int ph, int pw,
int dh, int dw, boolean isSameMode, Pooling2D.Pooling2DType type, Pooling2D.Divisor divisor,
double extra, int virtualHeight, int virtualWidth, INDArra... | [
"public",
"static",
"INDArray",
"pooling2D",
"(",
"INDArray",
"img",
",",
"int",
"kh",
",",
"int",
"kw",
",",
"int",
"sy",
",",
"int",
"sx",
",",
"int",
"ph",
",",
"int",
"pw",
",",
"int",
"dh",
",",
"int",
"dw",
",",
"boolean",
"isSameMode",
",",
... | Pooling 2d implementation
@param img
@param kh
@param kw
@param sy
@param sx
@param ph
@param pw
@param dh
@param dw
@param isSameMode
@param type
@param extra optional argument. I.e. used in pnorm pooling.
@param virtualHeight
@param virtualWidth
@param out
@return | [
"Pooling",
"2d",
"implementation"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java#L235-L260 |
128,177 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java | Convolution.outSize | @Deprecated
public static int outSize(int size, int k, int s, int p, int dilation, boolean coverAll) {
k = effectiveKernelSize(k, dilation);
if (coverAll)
return (size + p * 2 - k + s - 1) / s + 1;
else
return (size + p * 2 - k) / s + 1;
} | java | @Deprecated
public static int outSize(int size, int k, int s, int p, int dilation, boolean coverAll) {
k = effectiveKernelSize(k, dilation);
if (coverAll)
return (size + p * 2 - k + s - 1) / s + 1;
else
return (size + p * 2 - k) / s + 1;
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"outSize",
"(",
"int",
"size",
",",
"int",
"k",
",",
"int",
"s",
",",
"int",
"p",
",",
"int",
"dilation",
",",
"boolean",
"coverAll",
")",
"{",
"k",
"=",
"effectiveKernelSize",
"(",
"k",
",",
"dilation",
... | The out size for a convolution
@param size
@param k
@param s
@param p
@param coverAll
@return | [
"The",
"out",
"size",
"for",
"a",
"convolution"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java#L322-L330 |
128,178 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java | Convolution.conv2d | public static INDArray conv2d(INDArray input, INDArray kernel, Type type) {
return Nd4j.getConvolution().conv2d(input, kernel, type);
} | java | public static INDArray conv2d(INDArray input, INDArray kernel, Type type) {
return Nd4j.getConvolution().conv2d(input, kernel, type);
} | [
"public",
"static",
"INDArray",
"conv2d",
"(",
"INDArray",
"input",
",",
"INDArray",
"kernel",
",",
"Type",
"type",
")",
"{",
"return",
"Nd4j",
".",
"getConvolution",
"(",
")",
".",
"conv2d",
"(",
"input",
",",
"kernel",
",",
"type",
")",
";",
"}"
] | 2d convolution (aka the last 2 dimensions
@param input the input to op
@param kernel the kernel to convolve with
@param type
@return | [
"2d",
"convolution",
"(",
"aka",
"the",
"last",
"2",
"dimensions"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java#L355-L357 |
128,179 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/cache/TadDescriptor.java | TadDescriptor.dataBufferToArray | public static long[] dataBufferToArray(DataBuffer buffer) {
int rank = buffer.getInt(0);
val ret = new long[Shape.shapeInfoLength(rank)];
ret[0] = rank;
for (int e = 1; e < Shape.shapeInfoLength(rank); e++) {
ret[e] = buffer.getInt(e);
}
return ret;
} | java | public static long[] dataBufferToArray(DataBuffer buffer) {
int rank = buffer.getInt(0);
val ret = new long[Shape.shapeInfoLength(rank)];
ret[0] = rank;
for (int e = 1; e < Shape.shapeInfoLength(rank); e++) {
ret[e] = buffer.getInt(e);
}
return ret;
} | [
"public",
"static",
"long",
"[",
"]",
"dataBufferToArray",
"(",
"DataBuffer",
"buffer",
")",
"{",
"int",
"rank",
"=",
"buffer",
".",
"getInt",
"(",
"0",
")",
";",
"val",
"ret",
"=",
"new",
"long",
"[",
"Shape",
".",
"shapeInfoLength",
"(",
"rank",
")",... | Obtain the values from the shape buffer
for the array
@param buffer the buffer to get the values from
@return the int array version of this data buffer | [
"Obtain",
"the",
"values",
"from",
"the",
"shape",
"buffer",
"for",
"the",
"array"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/cache/TadDescriptor.java#L72-L81 |
128,180 | deeplearning4j/deeplearning4j | arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/config/OptimizationConfiguration.java | OptimizationConfiguration.fromYaml | public static OptimizationConfiguration fromYaml(String json) {
try {
return JsonMapper.getYamlMapper().readValue(json, OptimizationConfiguration.class);
} catch (IOException e) {
throw new RuntimeException(e);
}
} | java | public static OptimizationConfiguration fromYaml(String json) {
try {
return JsonMapper.getYamlMapper().readValue(json, OptimizationConfiguration.class);
} catch (IOException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"OptimizationConfiguration",
"fromYaml",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"return",
"JsonMapper",
".",
"getYamlMapper",
"(",
")",
".",
"readValue",
"(",
"json",
",",
"OptimizationConfiguration",
".",
"class",
")",
";",
"}",
"cat... | Create an optimization configuration from the json
@param json the json to create the config from
For type definitions
@see OptimizationConfiguration | [
"Create",
"an",
"optimization",
"configuration",
"from",
"the",
"json"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/config/OptimizationConfiguration.java#L176-L182 |
128,181 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/ROCBinary.java | ROCBinary.calculateAverageAuc | public double calculateAverageAuc() {
double ret = 0.0;
for (int i = 0; i < numLabels(); i++) {
ret += calculateAUC(i);
}
return ret / (double) numLabels();
} | java | public double calculateAverageAuc() {
double ret = 0.0;
for (int i = 0; i < numLabels(); i++) {
ret += calculateAUC(i);
}
return ret / (double) numLabels();
} | [
"public",
"double",
"calculateAverageAuc",
"(",
")",
"{",
"double",
"ret",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numLabels",
"(",
")",
";",
"i",
"++",
")",
"{",
"ret",
"+=",
"calculateAUC",
"(",
"i",
")",
";",
"}",
... | Macro-average AUC for all outcomes
@return the (macro-)average AUC for all outcomes. | [
"Macro",
"-",
"average",
"AUC",
"for",
"all",
"outcomes"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/ROCBinary.java#L284-L291 |
128,182 | deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronUtil.java | AeronUtil.subscriberLoop | public static Consumer<Subscription> subscriberLoop(final FragmentHandler fragmentHandler, final int limit,
final AtomicBoolean running, final AtomicBoolean launched) {
final IdleStrategy idleStrategy = new BusySpinIdleStrategy();
return subscriberLoop(fragmentHandler, limit, running... | java | public static Consumer<Subscription> subscriberLoop(final FragmentHandler fragmentHandler, final int limit,
final AtomicBoolean running, final AtomicBoolean launched) {
final IdleStrategy idleStrategy = new BusySpinIdleStrategy();
return subscriberLoop(fragmentHandler, limit, running... | [
"public",
"static",
"Consumer",
"<",
"Subscription",
">",
"subscriberLoop",
"(",
"final",
"FragmentHandler",
"fragmentHandler",
",",
"final",
"int",
"limit",
",",
"final",
"AtomicBoolean",
"running",
",",
"final",
"AtomicBoolean",
"launched",
")",
"{",
"final",
"I... | Return a reusable, parametrized
event loop that calls a
default idler
when no messages are received
@param fragmentHandler to be called back for each message.
@param limit passed to {@link Subscription#poll(FragmentHandler, int)}
@param running indication for loop
@return loop function | [
"Return",
"a",
"reusable",
"parametrized",
"event",
"loop",
"that",
"calls",
"a",
"default",
"idler",
"when",
"no",
"messages",
"are",
"received"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronUtil.java#L89-L93 |
128,183 | deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronUtil.java | AeronUtil.subscriberLoop | public static Consumer<Subscription> subscriberLoop(final FragmentHandler fragmentHandler, final int limit,
final AtomicBoolean running, final IdleStrategy idleStrategy, final AtomicBoolean launched) {
return (subscription) -> {
try {
while (running.get()) {
... | java | public static Consumer<Subscription> subscriberLoop(final FragmentHandler fragmentHandler, final int limit,
final AtomicBoolean running, final IdleStrategy idleStrategy, final AtomicBoolean launched) {
return (subscription) -> {
try {
while (running.get()) {
... | [
"public",
"static",
"Consumer",
"<",
"Subscription",
">",
"subscriberLoop",
"(",
"final",
"FragmentHandler",
"fragmentHandler",
",",
"final",
"int",
"limit",
",",
"final",
"AtomicBoolean",
"running",
",",
"final",
"IdleStrategy",
"idleStrategy",
",",
"final",
"Atomi... | Return a reusable, parameterized event
loop that calls and idler
when no messages are received
@param fragmentHandler to be called back for each message.
@param limit passed to {@link Subscription#poll(FragmentHandler, int)}
@param running indication for loop
@param idleStrategy to use for loop
@r... | [
"Return",
"a",
"reusable",
"parameterized",
"event",
"loop",
"that",
"calls",
"and",
"idler",
"when",
"no",
"messages",
"are",
"received"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronUtil.java#L106-L118 |
128,184 | deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronUtil.java | AeronUtil.printAvailableImage | public static void printAvailableImage(final Image image) {
final Subscription subscription = image.subscription();
System.out.println(String.format("Available image on %s streamId=%d sessionId=%d from %s",
subscription.channel(), subscription.streamId(), image.sessionId(), image... | java | public static void printAvailableImage(final Image image) {
final Subscription subscription = image.subscription();
System.out.println(String.format("Available image on %s streamId=%d sessionId=%d from %s",
subscription.channel(), subscription.streamId(), image.sessionId(), image... | [
"public",
"static",
"void",
"printAvailableImage",
"(",
"final",
"Image",
"image",
")",
"{",
"final",
"Subscription",
"subscription",
"=",
"image",
".",
"subscription",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"String",
".",
"format",
"(",
... | Print the information for an available image to stdout.
@param image that has been created | [
"Print",
"the",
"information",
"for",
"an",
"available",
"image",
"to",
"stdout",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronUtil.java#L170-L174 |
128,185 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-cuda/src/main/java/org/deeplearning4j/nn/layers/BaseCudnnHelper.java | BaseCudnnHelper.adaptForTensorDescr | protected static int[] adaptForTensorDescr(int[] shapeOrStrides){
if(shapeOrStrides.length >= 4)
return shapeOrStrides;
int[] out = new int[4];
int i=0;
for(; i<shapeOrStrides.length; i++ ){
out[i] = shapeOrStrides[i];
}
for(; i<4; i++ ){
... | java | protected static int[] adaptForTensorDescr(int[] shapeOrStrides){
if(shapeOrStrides.length >= 4)
return shapeOrStrides;
int[] out = new int[4];
int i=0;
for(; i<shapeOrStrides.length; i++ ){
out[i] = shapeOrStrides[i];
}
for(; i<4; i++ ){
... | [
"protected",
"static",
"int",
"[",
"]",
"adaptForTensorDescr",
"(",
"int",
"[",
"]",
"shapeOrStrides",
")",
"{",
"if",
"(",
"shapeOrStrides",
".",
"length",
">=",
"4",
")",
"return",
"shapeOrStrides",
";",
"int",
"[",
"]",
"out",
"=",
"new",
"int",
"[",
... | From CuDNN documentation -
"Tensors are restricted to having at least 4 dimensions... When working with lower dimensional data, it is
recommended that the user create a 4Dtensor, and set the size along unused dimensions to 1."
This method implements that - basically appends 1s to the end (shape or stride) to make it l... | [
"From",
"CuDNN",
"documentation",
"-",
"Tensors",
"are",
"restricted",
"to",
"having",
"at",
"least",
"4",
"dimensions",
"...",
"When",
"working",
"with",
"lower",
"dimensional",
"data",
"it",
"is",
"recommended",
"that",
"the",
"user",
"create",
"a",
"4Dtenso... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-cuda/src/main/java/org/deeplearning4j/nn/layers/BaseCudnnHelper.java#L234-L246 |
128,186 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.checkBufferCoherence | protected void checkBufferCoherence(){
if (values.length() < length){
throw new IllegalStateException("nnz is larger than capacity of buffers");
}
if (values.length() * rank() != indices.length()){
throw new IllegalArgumentException("Sizes of values, indices and shape ar... | java | protected void checkBufferCoherence(){
if (values.length() < length){
throw new IllegalStateException("nnz is larger than capacity of buffers");
}
if (values.length() * rank() != indices.length()){
throw new IllegalArgumentException("Sizes of values, indices and shape ar... | [
"protected",
"void",
"checkBufferCoherence",
"(",
")",
"{",
"if",
"(",
"values",
".",
"length",
"(",
")",
"<",
"length",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"nnz is larger than capacity of buffers\"",
")",
";",
"}",
"if",
"(",
"values",
"... | Check that the length of indices and values are coherent and matches the rank of the matrix. | [
"Check",
"that",
"the",
"length",
"of",
"indices",
"and",
"values",
"are",
"coherent",
"and",
"matches",
"the",
"rank",
"of",
"the",
"matrix",
"."
] | 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#L143-L151 |
128,187 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.createSparseInformationBuffer | protected static DataBuffer createSparseInformationBuffer(int rank){
int[] flags = new int[rank];
long[] sparseOffsets = new long[rank];
int[] hiddenDimension = new int[] {-1};
return Nd4j.getSparseInfoProvider().createSparseInformation(flags, sparseOffsets,
hiddenDimensi... | java | protected static DataBuffer createSparseInformationBuffer(int rank){
int[] flags = new int[rank];
long[] sparseOffsets = new long[rank];
int[] hiddenDimension = new int[] {-1};
return Nd4j.getSparseInfoProvider().createSparseInformation(flags, sparseOffsets,
hiddenDimensi... | [
"protected",
"static",
"DataBuffer",
"createSparseInformationBuffer",
"(",
"int",
"rank",
")",
"{",
"int",
"[",
"]",
"flags",
"=",
"new",
"int",
"[",
"rank",
"]",
";",
"long",
"[",
"]",
"sparseOffsets",
"=",
"new",
"long",
"[",
"rank",
"]",
";",
"int",
... | Create a SparseInfo databuffer given rank if of the sparse matrix.
@param rank
@return | [
"Create",
"a",
"SparseInfo",
"databuffer",
"given",
"rank",
"if",
"of",
"the",
"sparse",
"matrix",
"."
] | 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#L158-L164 |
128,188 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.createValueBuffer | protected static DataBuffer createValueBuffer(float[] values) {
checkNotNull(values);
if (values.length == 0){
return Nd4j.createBuffer(1);
}
return Nd4j.createBuffer(values);
} | java | protected static DataBuffer createValueBuffer(float[] values) {
checkNotNull(values);
if (values.length == 0){
return Nd4j.createBuffer(1);
}
return Nd4j.createBuffer(values);
} | [
"protected",
"static",
"DataBuffer",
"createValueBuffer",
"(",
"float",
"[",
"]",
"values",
")",
"{",
"checkNotNull",
"(",
"values",
")",
";",
"if",
"(",
"values",
".",
"length",
"==",
"0",
")",
"{",
"return",
"Nd4j",
".",
"createBuffer",
"(",
"1",
")",
... | Create a DataBuffer for values of given array of values.
@param values
@return | [
"Create",
"a",
"DataBuffer",
"for",
"values",
"of",
"given",
"array",
"of",
"values",
"."
] | 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#L172-L178 |
128,189 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.createIndiceBuffer | protected static DataBuffer createIndiceBuffer(long[][] indices, long[] shape){
checkNotNull(indices);
checkNotNull(shape);
if(indices.length == 0){
return Nd4j.getDataBufferFactory().createLong(shape.length);
}
if (indices.length == shape.length) {
retur... | java | protected static DataBuffer createIndiceBuffer(long[][] indices, long[] shape){
checkNotNull(indices);
checkNotNull(shape);
if(indices.length == 0){
return Nd4j.getDataBufferFactory().createLong(shape.length);
}
if (indices.length == shape.length) {
retur... | [
"protected",
"static",
"DataBuffer",
"createIndiceBuffer",
"(",
"long",
"[",
"]",
"[",
"]",
"indices",
",",
"long",
"[",
"]",
"shape",
")",
"{",
"checkNotNull",
"(",
"indices",
")",
";",
"checkNotNull",
"(",
"shape",
")",
";",
"if",
"(",
"indices",
".",
... | Create a DataBuffer for indices of given arrays of indices.
@param indices
@param shape
@return | [
"Create",
"a",
"DataBuffer",
"for",
"indices",
"of",
"given",
"arrays",
"of",
"indices",
"."
] | 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#L202-L214 |
128,190 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.translateToPhysical | public long[] translateToPhysical(long[] virtualIndexes) {
long[] physicalIndexes = new long[underlyingRank()];
int idxPhy = 0;
int hidden = 0;
for (int idxVir = 0; idxVir < virtualIndexes.length; idxVir++) {
if (hidden < getNumHiddenDimension() && hiddenDimensions()[hidden... | java | public long[] translateToPhysical(long[] virtualIndexes) {
long[] physicalIndexes = new long[underlyingRank()];
int idxPhy = 0;
int hidden = 0;
for (int idxVir = 0; idxVir < virtualIndexes.length; idxVir++) {
if (hidden < getNumHiddenDimension() && hiddenDimensions()[hidden... | [
"public",
"long",
"[",
"]",
"translateToPhysical",
"(",
"long",
"[",
"]",
"virtualIndexes",
")",
"{",
"long",
"[",
"]",
"physicalIndexes",
"=",
"new",
"long",
"[",
"underlyingRank",
"(",
")",
"]",
";",
"int",
"idxPhy",
"=",
"0",
";",
"int",
"hidden",
"... | Translate the view index to the corresponding index of the original ndarray
@param virtualIndexes the view indexes
@return the original indexes | [
"Translate",
"the",
"view",
"index",
"to",
"the",
"corresponding",
"index",
"of",
"the",
"original",
"ndarray"
] | 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#L298-L319 |
128,191 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.addOrUpdate | public void addOrUpdate(long[] indexes, double value) {
long[] physicalIndexes = isView() ? translateToPhysical(indexes) : indexes;
for (int i = 0; i < length; i++) {
long[] idx = getUnderlyingIndicesOf(i).asLong();
if (Arrays.equals(idx, physicalIndexes)) {
// ... | java | public void addOrUpdate(long[] indexes, double value) {
long[] physicalIndexes = isView() ? translateToPhysical(indexes) : indexes;
for (int i = 0; i < length; i++) {
long[] idx = getUnderlyingIndicesOf(i).asLong();
if (Arrays.equals(idx, physicalIndexes)) {
// ... | [
"public",
"void",
"addOrUpdate",
"(",
"long",
"[",
"]",
"indexes",
",",
"double",
"value",
")",
"{",
"long",
"[",
"]",
"physicalIndexes",
"=",
"isView",
"(",
")",
"?",
"translateToPhysical",
"(",
"indexes",
")",
":",
"indexes",
";",
"for",
"(",
"int",
... | Add a new element in the ndarray or update the value if there is already a non-null element at this position
@param indexes the indexes of the element to be added
@param value the value of the element to be added | [
"Add",
"a",
"new",
"element",
"in",
"the",
"ndarray",
"or",
"update",
"the",
"value",
"if",
"there",
"is",
"already",
"a",
"non",
"-",
"null",
"element",
"at",
"this",
"position"
] | 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#L497-L540 |
128,192 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.removeEntry | public INDArray removeEntry(int idx) {
values = shiftLeft(values, idx + 1, 1, length());
indices = shiftLeft(indices, (int) (idx * shape.length() + shape.length()), (int) shape.length(),
indices.length());
return this;
} | java | public INDArray removeEntry(int idx) {
values = shiftLeft(values, idx + 1, 1, length());
indices = shiftLeft(indices, (int) (idx * shape.length() + shape.length()), (int) shape.length(),
indices.length());
return this;
} | [
"public",
"INDArray",
"removeEntry",
"(",
"int",
"idx",
")",
"{",
"values",
"=",
"shiftLeft",
"(",
"values",
",",
"idx",
"+",
"1",
",",
"1",
",",
"length",
"(",
")",
")",
";",
"indices",
"=",
"shiftLeft",
"(",
"indices",
",",
"(",
"int",
")",
"(",
... | Remove an element of the ndarray
@param idx the index of the element to be removed
@return the ndarray | [
"Remove",
"an",
"element",
"of",
"the",
"ndarray"
] | 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#L564-L569 |
128,193 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.reverseIndexes | public int reverseIndexes(int... indexes) {
long[] idx = translateToPhysical(ArrayUtil.toLongArray(indexes));
sort();
// FIXME: int cast
return indexesBinarySearch(0, (int) length(), ArrayUtil.toInts(idx));
} | java | public int reverseIndexes(int... indexes) {
long[] idx = translateToPhysical(ArrayUtil.toLongArray(indexes));
sort();
// FIXME: int cast
return indexesBinarySearch(0, (int) length(), ArrayUtil.toInts(idx));
} | [
"public",
"int",
"reverseIndexes",
"(",
"int",
"...",
"indexes",
")",
"{",
"long",
"[",
"]",
"idx",
"=",
"translateToPhysical",
"(",
"ArrayUtil",
".",
"toLongArray",
"(",
"indexes",
")",
")",
";",
"sort",
"(",
")",
";",
"// FIXME: int cast",
"return",
"ind... | Return the index of the value corresponding to the indexes
@param indexes
@return index of the value | [
"Return",
"the",
"index",
"of",
"the",
"value",
"corresponding",
"to",
"the",
"indexes"
] | 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#L615-L621 |
128,194 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.indexesBinarySearch | public int indexesBinarySearch(int lowerBound, int upperBound, int[] idx) {
int min = lowerBound;
int max = upperBound;
int mid = (max + min) / 2;
int[] midIdx = getUnderlyingIndicesOf(mid).asInt();
if (Arrays.equals(idx, midIdx)) {
return mid;
}
if (... | java | public int indexesBinarySearch(int lowerBound, int upperBound, int[] idx) {
int min = lowerBound;
int max = upperBound;
int mid = (max + min) / 2;
int[] midIdx = getUnderlyingIndicesOf(mid).asInt();
if (Arrays.equals(idx, midIdx)) {
return mid;
}
if (... | [
"public",
"int",
"indexesBinarySearch",
"(",
"int",
"lowerBound",
",",
"int",
"upperBound",
",",
"int",
"[",
"]",
"idx",
")",
"{",
"int",
"min",
"=",
"lowerBound",
";",
"int",
"max",
"=",
"upperBound",
";",
"int",
"mid",
"=",
"(",
"max",
"+",
"min",
... | Return the position of the idx array into the indexes buffer between the lower and upper bound.
@param idx a set of coordinates
@param lowerBound the lower bound of the position
@param upperBound the upper bound of the position
@return the position of the idx array into the indexes buffers, which corresponds to the pos... | [
"Return",
"the",
"position",
"of",
"the",
"idx",
"array",
"into",
"the",
"indexes",
"buffer",
"between",
"the",
"lower",
"and",
"upper",
"bound",
"."
] | 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#L631-L650 |
128,195 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.getVectorCoordinates | @Override
public DataBuffer getVectorCoordinates() {
int idx;
if (isRowVector()) {
idx = 1;
} else if (isColumnVector()) {
idx = 0;
} else {
throw new UnsupportedOperationException();
}
// FIXME: int cast
int[] temp = new i... | java | @Override
public DataBuffer getVectorCoordinates() {
int idx;
if (isRowVector()) {
idx = 1;
} else if (isColumnVector()) {
idx = 0;
} else {
throw new UnsupportedOperationException();
}
// FIXME: int cast
int[] temp = new i... | [
"@",
"Override",
"public",
"DataBuffer",
"getVectorCoordinates",
"(",
")",
"{",
"int",
"idx",
";",
"if",
"(",
"isRowVector",
"(",
")",
")",
"{",
"idx",
"=",
"1",
";",
"}",
"else",
"if",
"(",
"isColumnVector",
"(",
")",
")",
"{",
"idx",
"=",
"0",
";... | Returns the indices of non-zero element of the vector
@return indices in Databuffer | [
"Returns",
"the",
"indices",
"of",
"non",
"-",
"zero",
"element",
"of",
"the",
"vector"
] | 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#L870-L887 |
128,196 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.toDense | @Override
public INDArray toDense() {
// TODO support view conversion
INDArray result = Nd4j.zeros(shape());
switch (data().dataType()) {
case DOUBLE:
for (int i = 0; i < length; i++) {
int[] idx = getUnderlyingIndicesOf(i).asInt();
... | java | @Override
public INDArray toDense() {
// TODO support view conversion
INDArray result = Nd4j.zeros(shape());
switch (data().dataType()) {
case DOUBLE:
for (int i = 0; i < length; i++) {
int[] idx = getUnderlyingIndicesOf(i).asInt();
... | [
"@",
"Override",
"public",
"INDArray",
"toDense",
"(",
")",
"{",
"// TODO support view conversion",
"INDArray",
"result",
"=",
"Nd4j",
".",
"zeros",
"(",
"shape",
"(",
")",
")",
";",
"switch",
"(",
"data",
"(",
")",
".",
"dataType",
"(",
")",
")",
"{",
... | Converts the sparse ndarray into a dense one
@return a dense ndarray | [
"Converts",
"the",
"sparse",
"ndarray",
"into",
"a",
"dense",
"one"
] | 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#L893-L917 |
128,197 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.createSparseOffsets | private long[] createSparseOffsets(long offset) {
// resolve the offsets in the view dimension
int underlyingRank = sparseOffsets().length;
long[] newOffsets = new long[rank()];
List<Long> shapeList = Longs.asList(shape());
int penultimate = rank() - 1;
for (int i = 0; i... | java | private long[] createSparseOffsets(long offset) {
// resolve the offsets in the view dimension
int underlyingRank = sparseOffsets().length;
long[] newOffsets = new long[rank()];
List<Long> shapeList = Longs.asList(shape());
int penultimate = rank() - 1;
for (int i = 0; i... | [
"private",
"long",
"[",
"]",
"createSparseOffsets",
"(",
"long",
"offset",
")",
"{",
"// resolve the offsets in the view dimension",
"int",
"underlyingRank",
"=",
"sparseOffsets",
"(",
")",
".",
"length",
";",
"long",
"[",
"]",
"newOffsets",
"=",
"new",
"long",
... | Compute the sparse offsets of the view we are getting, for each dimension according to the original ndarray
@param offset the offset of the view
@return an int array containing the sparse offsets | [
"Compute",
"the",
"sparse",
"offsets",
"of",
"the",
"view",
"we",
"are",
"getting",
"for",
"each",
"dimension",
"according",
"to",
"the",
"original",
"ndarray"
] | 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#L929-L955 |
128,198 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.getUnderlyingIndicesOf | public DataBuffer getUnderlyingIndicesOf(int i) {
int from = underlyingRank() * i;
//int to = from + underlyingRank();
int[] res = new int[underlyingRank()];
for(int j = 0; j< underlyingRank(); j++){
res[j] = indices.getInt(from + j);
}
///int[] arr = Arrays.... | java | public DataBuffer getUnderlyingIndicesOf(int i) {
int from = underlyingRank() * i;
//int to = from + underlyingRank();
int[] res = new int[underlyingRank()];
for(int j = 0; j< underlyingRank(); j++){
res[j] = indices.getInt(from + j);
}
///int[] arr = Arrays.... | [
"public",
"DataBuffer",
"getUnderlyingIndicesOf",
"(",
"int",
"i",
")",
"{",
"int",
"from",
"=",
"underlyingRank",
"(",
")",
"*",
"i",
";",
"//int to = from + underlyingRank();",
"int",
"[",
"]",
"res",
"=",
"new",
"int",
"[",
"underlyingRank",
"(",
")",
"]"... | Returns the underlying indices of the element of the given index
such as there really are in the original ndarray
@param i the index of the element+
@return a dataBuffer containing the indices of element | [
"Returns",
"the",
"underlying",
"indices",
"of",
"the",
"element",
"of",
"the",
"given",
"index",
"such",
"as",
"there",
"really",
"are",
"in",
"the",
"original",
"ndarray"
] | 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#L1039-L1049 |
128,199 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.getIndicesOf | public DataBuffer getIndicesOf(int i) {
int from = underlyingRank() * i;
int to = from + underlyingRank(); //not included
int[] arr = new int[rank];
int j = 0; // iterator over underlying indices
int k = 0; //iterator over hiddenIdx
for (int dim = 0; dim < rank; dim++) {... | java | public DataBuffer getIndicesOf(int i) {
int from = underlyingRank() * i;
int to = from + underlyingRank(); //not included
int[] arr = new int[rank];
int j = 0; // iterator over underlying indices
int k = 0; //iterator over hiddenIdx
for (int dim = 0; dim < rank; dim++) {... | [
"public",
"DataBuffer",
"getIndicesOf",
"(",
"int",
"i",
")",
"{",
"int",
"from",
"=",
"underlyingRank",
"(",
")",
"*",
"i",
";",
"int",
"to",
"=",
"from",
"+",
"underlyingRank",
"(",
")",
";",
"//not included",
"int",
"[",
"]",
"arr",
"=",
"new",
"i... | Returns the indices of the element of the given index in the array context
@param i the index of the element
@return a dataBuffer containing the indices of element | [
"Returns",
"the",
"indices",
"of",
"the",
"element",
"of",
"the",
"given",
"index",
"in",
"the",
"array",
"context"
] | 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#L1057-L1074 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.