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,800 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/HostProvisioner.java | HostProvisioner.uploadForDeployment | public void uploadForDeployment(String from, String to) throws Exception {
File fromFile = new File(from);
if (!to.isEmpty() && fromFile.isDirectory())
mkDir(to);
else
upload(from, to);
} | java | public void uploadForDeployment(String from, String to) throws Exception {
File fromFile = new File(from);
if (!to.isEmpty() && fromFile.isDirectory())
mkDir(to);
else
upload(from, to);
} | [
"public",
"void",
"uploadForDeployment",
"(",
"String",
"from",
",",
"String",
"to",
")",
"throws",
"Exception",
"{",
"File",
"fromFile",
"=",
"new",
"File",
"(",
"from",
")",
";",
"if",
"(",
"!",
"to",
".",
"isEmpty",
"(",
")",
"&&",
"fromFile",
".",
... | Creates the directory for the file if necessary
and uploads the file
@param from the directory to upload from
@param to the destination directory on the remote server
@throws Exception | [
"Creates",
"the",
"directory",
"for",
"the",
"file",
"if",
"necessary",
"and",
"uploads",
"the",
"file"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/HostProvisioner.java#L150-L158 |
128,801 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/HostProvisioner.java | HostProvisioner.mkDir | private void mkDir(String dir) throws Exception {
Session session = getSession();
session.connect();
Channel channel = session.openChannel("sftp");
channel.connect();
ChannelSftp c = (ChannelSftp) channel;
if (!fileExists(dir, c))
c.mkdir(dir);
c.exit... | java | private void mkDir(String dir) throws Exception {
Session session = getSession();
session.connect();
Channel channel = session.openChannel("sftp");
channel.connect();
ChannelSftp c = (ChannelSftp) channel;
if (!fileExists(dir, c))
c.mkdir(dir);
c.exit... | [
"private",
"void",
"mkDir",
"(",
"String",
"dir",
")",
"throws",
"Exception",
"{",
"Session",
"session",
"=",
"getSession",
"(",
")",
";",
"session",
".",
"connect",
"(",
")",
";",
"Channel",
"channel",
"=",
"session",
".",
"openChannel",
"(",
"\"sftp\"",
... | creates the directory to upload to | [
"creates",
"the",
"directory",
"to",
"upload",
"to"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/HostProvisioner.java#L165-L176 |
128,802 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/HostProvisioner.java | HostProvisioner.upload | private void upload(String fileOrDir, String uploadRootDir) throws Exception {
if (uploadRootDir.isEmpty())
uploadRootDir = ".";
File origin = new File(fileOrDir);
if (fileOrDir.endsWith(".tar") || fileOrDir.endsWith(".tar.gz")) {
upload(new File(fileOrDir), uploadRootDi... | java | private void upload(String fileOrDir, String uploadRootDir) throws Exception {
if (uploadRootDir.isEmpty())
uploadRootDir = ".";
File origin = new File(fileOrDir);
if (fileOrDir.endsWith(".tar") || fileOrDir.endsWith(".tar.gz")) {
upload(new File(fileOrDir), uploadRootDi... | [
"private",
"void",
"upload",
"(",
"String",
"fileOrDir",
",",
"String",
"uploadRootDir",
")",
"throws",
"Exception",
"{",
"if",
"(",
"uploadRootDir",
".",
"isEmpty",
"(",
")",
")",
"uploadRootDir",
"=",
"\".\"",
";",
"File",
"origin",
"=",
"new",
"File",
"... | uploads the file or listed files in a directory | [
"uploads",
"the",
"file",
"or",
"listed",
"files",
"in",
"a",
"directory"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/HostProvisioner.java#L189-L205 |
128,803 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/StaticWord2Vec.java | StaticWord2Vec.init | protected void init() {
if (storage.size() != vocabCache.numWords())
throw new RuntimeException("Number of words in Vocab isn't matching number of stored Vectors. vocab: ["
+ vocabCache.numWords() + "]; storage: [" + storage.size() + "]");
// initializing device ... | java | protected void init() {
if (storage.size() != vocabCache.numWords())
throw new RuntimeException("Number of words in Vocab isn't matching number of stored Vectors. vocab: ["
+ vocabCache.numWords() + "]; storage: [" + storage.size() + "]");
// initializing device ... | [
"protected",
"void",
"init",
"(",
")",
"{",
"if",
"(",
"storage",
".",
"size",
"(",
")",
"!=",
"vocabCache",
".",
"numWords",
"(",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Number of words in Vocab isn't matching number of stored Vectors. vocab: [\"",
"+... | Init method validates configuration defined using | [
"Init",
"method",
"validates",
"configuration",
"defined",
"using"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/StaticWord2Vec.java#L67-L76 |
128,804 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/StaticWord2Vec.java | StaticWord2Vec.similarity | @Override
public double similarity(String label1, String label2) {
if (label1 == null || label2 == null) {
log.debug("LABELS: " + label1 + ": " + (label1 == null ? "null" : "exists") + ";" + label2 + " vec2:"
+ (label2 == null ? "null" : "exists"));
return... | java | @Override
public double similarity(String label1, String label2) {
if (label1 == null || label2 == null) {
log.debug("LABELS: " + label1 + ": " + (label1 == null ? "null" : "exists") + ";" + label2 + " vec2:"
+ (label2 == null ? "null" : "exists"));
return... | [
"@",
"Override",
"public",
"double",
"similarity",
"(",
"String",
"label1",
",",
"String",
"label2",
")",
"{",
"if",
"(",
"label1",
"==",
"null",
"||",
"label2",
"==",
"null",
")",
"{",
"log",
".",
"debug",
"(",
"\"LABELS: \"",
"+",
"label1",
"+",
"\":... | Returns the similarity of 2 words
@param label1 the first word
@param label2 the second word
@return a normalized similarity (cosine similarity) | [
"Returns",
"the",
"similarity",
"of",
"2",
"words"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/StaticWord2Vec.java#L281-L305 |
128,805 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/messages/intercom/DistributedCbowDotMessage.java | DistributedCbowDotMessage.processMessage | @Override
public void processMessage() {
// this only picks up new training round
//log.info("sI_{} Starting CBOW dot...", transport.getShardIndex());
CbowRequestMessage cbrm = new CbowRequestMessage(rowsA, rowsB, w1, codes, negSamples, alpha, 119);
if (negSamples > 0) {
... | java | @Override
public void processMessage() {
// this only picks up new training round
//log.info("sI_{} Starting CBOW dot...", transport.getShardIndex());
CbowRequestMessage cbrm = new CbowRequestMessage(rowsA, rowsB, w1, codes, negSamples, alpha, 119);
if (negSamples > 0) {
... | [
"@",
"Override",
"public",
"void",
"processMessage",
"(",
")",
"{",
"// this only picks up new training round",
"//log.info(\"sI_{} Starting CBOW dot...\", transport.getShardIndex());",
"CbowRequestMessage",
"cbrm",
"=",
"new",
"CbowRequestMessage",
"(",
"rowsA",
",",
"rowsB",
... | This method calculates dot of gives rows, with averaging applied to rowsA, as required by CBoW | [
"This",
"method",
"calculates",
"dot",
"of",
"gives",
"rows",
"with",
"averaging",
"applied",
"to",
"rowsA",
"as",
"required",
"by",
"CBoW"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/messages/intercom/DistributedCbowDotMessage.java#L81-L135 |
128,806 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/lsh/RandomProjectionLSH.java | RandomProjectionLSH.hash | public INDArray hash(INDArray data) {
if (data.shape()[1] != inDimension){
throw new ND4JIllegalStateException(
String.format("Invalid shape: Requested INDArray shape %s, this table expects dimension %d",
Arrays.toString(data.shape()), inDimension));
... | java | public INDArray hash(INDArray data) {
if (data.shape()[1] != inDimension){
throw new ND4JIllegalStateException(
String.format("Invalid shape: Requested INDArray shape %s, this table expects dimension %d",
Arrays.toString(data.shape()), inDimension));
... | [
"public",
"INDArray",
"hash",
"(",
"INDArray",
"data",
")",
"{",
"if",
"(",
"data",
".",
"shape",
"(",
")",
"[",
"1",
"]",
"!=",
"inDimension",
")",
"{",
"throw",
"new",
"ND4JIllegalStateException",
"(",
"String",
".",
"format",
"(",
"\"Invalid shape: Requ... | Returns hash values for a particular query
@param data a query vector
@return its hashed value | [
"Returns",
"hash",
"values",
"for",
"a",
"particular",
"query"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/lsh/RandomProjectionLSH.java#L141-L150 |
128,807 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/lsh/RandomProjectionLSH.java | RandomProjectionLSH.rawBucketOf | INDArray rawBucketOf(INDArray query){
INDArray pattern = hash(query);
INDArray res = Nd4j.zeros(DataType.BOOL, index.shape());
Nd4j.getExecutioner().exec(new BroadcastEqualTo(index, pattern, res, -1));
return res.castTo(Nd4j.defaultFloatingPointType()).min(-1);
} | java | INDArray rawBucketOf(INDArray query){
INDArray pattern = hash(query);
INDArray res = Nd4j.zeros(DataType.BOOL, index.shape());
Nd4j.getExecutioner().exec(new BroadcastEqualTo(index, pattern, res, -1));
return res.castTo(Nd4j.defaultFloatingPointType()).min(-1);
} | [
"INDArray",
"rawBucketOf",
"(",
"INDArray",
"query",
")",
"{",
"INDArray",
"pattern",
"=",
"hash",
"(",
"query",
")",
";",
"INDArray",
"res",
"=",
"Nd4j",
".",
"zeros",
"(",
"DataType",
".",
"BOOL",
",",
"index",
".",
"shape",
"(",
")",
")",
";",
"Nd... | data elements in the same bucket as the query, without entropy | [
"data",
"elements",
"in",
"the",
"same",
"bucket",
"as",
"the",
"query",
"without",
"entropy"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/lsh/RandomProjectionLSH.java#L163-L169 |
128,808 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/lsh/RandomProjectionLSH.java | RandomProjectionLSH.bucketData | INDArray bucketData(INDArray query){
INDArray mask = bucket(query);
int nRes = mask.sum(0).getInt(0);
INDArray res = Nd4j.create(new int[] {nRes, inDimension});
int j = 0;
for (int i = 0; i < nRes; i++){
while (mask.getInt(j) == 0 && j < mask.length() - 1) {
... | java | INDArray bucketData(INDArray query){
INDArray mask = bucket(query);
int nRes = mask.sum(0).getInt(0);
INDArray res = Nd4j.create(new int[] {nRes, inDimension});
int j = 0;
for (int i = 0; i < nRes; i++){
while (mask.getInt(j) == 0 && j < mask.length() - 1) {
... | [
"INDArray",
"bucketData",
"(",
"INDArray",
"query",
")",
"{",
"INDArray",
"mask",
"=",
"bucket",
"(",
"query",
")",
";",
"int",
"nRes",
"=",
"mask",
".",
"sum",
"(",
"0",
")",
".",
"getInt",
"(",
"0",
")",
";",
"INDArray",
"res",
"=",
"Nd4j",
".",
... | data elements in the same entropy bucket as the query, | [
"data",
"elements",
"in",
"the",
"same",
"entropy",
"bucket",
"as",
"the",
"query"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/lsh/RandomProjectionLSH.java#L190-L203 |
128,809 | deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-gson/src/main/java/org/nd4j/serde/gson/GsonDeserializationUtils.java | GsonDeserializationUtils.deserializeRawJson | public static INDArray deserializeRawJson(String serializedRawArray) {
//String cleanedRawArray = serializedRawArray.replaceAll("(?<=[\\d])(,)(?=[\\d])", "");
String cleanedRawArray = serializedRawArray;
JsonArray jsonArray = JSON_PARSER.parse(cleanedRawArray).getAsJsonArray();
List<In... | java | public static INDArray deserializeRawJson(String serializedRawArray) {
//String cleanedRawArray = serializedRawArray.replaceAll("(?<=[\\d])(,)(?=[\\d])", "");
String cleanedRawArray = serializedRawArray;
JsonArray jsonArray = JSON_PARSER.parse(cleanedRawArray).getAsJsonArray();
List<In... | [
"public",
"static",
"INDArray",
"deserializeRawJson",
"(",
"String",
"serializedRawArray",
")",
"{",
"//String cleanedRawArray = serializedRawArray.replaceAll(\"(?<=[\\\\d])(,)(?=[\\\\d])\", \"\");",
"String",
"cleanedRawArray",
"=",
"serializedRawArray",
";",
"JsonArray",
"jsonArray... | Deserialize an ndarray
form json
@param serializedRawArray
@return | [
"Deserialize",
"an",
"ndarray",
"form",
"json"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-gson/src/main/java/org/nd4j/serde/gson/GsonDeserializationUtils.java#L53-L64 |
128,810 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/CudaMemoryManager.java | CudaMemoryManager.memcpy | @Override
public void memcpy(DataBuffer dstBuffer, DataBuffer srcBuffer) {
CudaContext context = (CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext();
if (dstBuffer instanceof CompressedDataBuffer && !(srcBuffer instanceof CompressedDataBuffer)) {
// destination i... | java | @Override
public void memcpy(DataBuffer dstBuffer, DataBuffer srcBuffer) {
CudaContext context = (CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext();
if (dstBuffer instanceof CompressedDataBuffer && !(srcBuffer instanceof CompressedDataBuffer)) {
// destination i... | [
"@",
"Override",
"public",
"void",
"memcpy",
"(",
"DataBuffer",
"dstBuffer",
",",
"DataBuffer",
"srcBuffer",
")",
"{",
"CudaContext",
"context",
"=",
"(",
"CudaContext",
")",
"AtomicAllocator",
".",
"getInstance",
"(",
")",
".",
"getDeviceContext",
"(",
")",
"... | This method provides basic memcpy functionality with respect to target environment
@param dstBuffer
@param srcBuffer | [
"This",
"method",
"provides",
"basic",
"memcpy",
"functionality",
"with",
"respect",
"to",
"target",
"environment"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/CudaMemoryManager.java#L160-L203 |
128,811 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/CudaMemoryManager.java | CudaMemoryManager.release | @Override
public void release(Pointer pointer, MemoryKind kind) {
if (kind == MemoryKind.DEVICE) {
NativeOpsHolder.getInstance().getDeviceNativeOps().freeDevice(pointer, 0);
pointer.setNull();
} else if (kind == MemoryKind.HOST) {
NativeOpsHolder.getInstance().get... | java | @Override
public void release(Pointer pointer, MemoryKind kind) {
if (kind == MemoryKind.DEVICE) {
NativeOpsHolder.getInstance().getDeviceNativeOps().freeDevice(pointer, 0);
pointer.setNull();
} else if (kind == MemoryKind.HOST) {
NativeOpsHolder.getInstance().get... | [
"@",
"Override",
"public",
"void",
"release",
"(",
"Pointer",
"pointer",
",",
"MemoryKind",
"kind",
")",
"{",
"if",
"(",
"kind",
"==",
"MemoryKind",
".",
"DEVICE",
")",
"{",
"NativeOpsHolder",
".",
"getInstance",
"(",
")",
".",
"getDeviceNativeOps",
"(",
"... | This method releases previously allocated memory chunk
@param pointer
@param kind
@return | [
"This",
"method",
"releases",
"previously",
"allocated",
"memory",
"chunk"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/CudaMemoryManager.java#L212-L221 |
128,812 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/DeviceLocal.java | DeviceLocal.get | @Nullable
public T get(int deviceId) {
try {
locksMap.get(deviceId).readLock().lock();
return backingMap.get(deviceId);
} finally {
locksMap.get(deviceId).readLock().unlock();
}
} | java | @Nullable
public T get(int deviceId) {
try {
locksMap.get(deviceId).readLock().lock();
return backingMap.get(deviceId);
} finally {
locksMap.get(deviceId).readLock().unlock();
}
} | [
"@",
"Nullable",
"public",
"T",
"get",
"(",
"int",
"deviceId",
")",
"{",
"try",
"{",
"locksMap",
".",
"get",
"(",
"deviceId",
")",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"return",
"backingMap",
".",
"get",
"(",
"deviceId",
")",
";",... | This method returns object local to target device
@param deviceId
@return | [
"This",
"method",
"returns",
"object",
"local",
"to",
"target",
"device"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/DeviceLocal.java#L61-L69 |
128,813 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/DeviceLocal.java | DeviceLocal.set | public void set(int deviceId, T object) {
try {
locksMap.get(deviceId).writeLock().lock();
backingMap.put(deviceId, object);
} finally {
locksMap.get(deviceId).writeLock().unlock();
}
} | java | public void set(int deviceId, T object) {
try {
locksMap.get(deviceId).writeLock().lock();
backingMap.put(deviceId, object);
} finally {
locksMap.get(deviceId).writeLock().unlock();
}
} | [
"public",
"void",
"set",
"(",
"int",
"deviceId",
",",
"T",
"object",
")",
"{",
"try",
"{",
"locksMap",
".",
"get",
"(",
"deviceId",
")",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"backingMap",
".",
"put",
"(",
"deviceId",
",",
"object... | This method sets object for specific device
@param deviceId
@param object | [
"This",
"method",
"sets",
"object",
"for",
"specific",
"device"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/DeviceLocal.java#L77-L84 |
128,814 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/DeviceLocal.java | DeviceLocal.clear | public void clear() {
int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread();
try {
locksMap.get(deviceId).writeLock().lock();
backingMap.remove(deviceId);
} finally {
locksMap.get(deviceId).writeLock().unlock();
}
} | java | public void clear() {
int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread();
try {
locksMap.get(deviceId).writeLock().lock();
backingMap.remove(deviceId);
} finally {
locksMap.get(deviceId).writeLock().unlock();
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"int",
"deviceId",
"=",
"Nd4j",
".",
"getAffinityManager",
"(",
")",
".",
"getDeviceForCurrentThread",
"(",
")",
";",
"try",
"{",
"locksMap",
".",
"get",
"(",
"deviceId",
")",
".",
"writeLock",
"(",
")",
".",
"... | This method removes object stored for current device | [
"This",
"method",
"removes",
"object",
"stored",
"for",
"current",
"device"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/DeviceLocal.java#L100-L108 |
128,815 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/context/impl/BasicContextPool.java | BasicContextPool.getDeviceBuffers | protected void getDeviceBuffers(CudaContext context, int deviceId) {
NativeOps nativeOps = NativeOpsHolder.getInstance().getDeviceNativeOps(); //((CudaExecutioner) Nd4j.getExecutioner()).getNativeOps();
// we hardcode sizeOf to sizeOf(double)
int sizeOf = 8;
val reductionPointer = nati... | java | protected void getDeviceBuffers(CudaContext context, int deviceId) {
NativeOps nativeOps = NativeOpsHolder.getInstance().getDeviceNativeOps(); //((CudaExecutioner) Nd4j.getExecutioner()).getNativeOps();
// we hardcode sizeOf to sizeOf(double)
int sizeOf = 8;
val reductionPointer = nati... | [
"protected",
"void",
"getDeviceBuffers",
"(",
"CudaContext",
"context",
",",
"int",
"deviceId",
")",
"{",
"NativeOps",
"nativeOps",
"=",
"NativeOpsHolder",
".",
"getInstance",
"(",
")",
".",
"getDeviceNativeOps",
"(",
")",
";",
"//((CudaExecutioner) Nd4j.getExecutione... | This method is used to allocate
@param context
@param deviceId | [
"This",
"method",
"is",
"used",
"to",
"allocate"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/context/impl/BasicContextPool.java#L291-L324 |
128,816 | deeplearning4j/deeplearning4j | nd4j/nd4j-context/src/main/java/org/nd4j/context/Nd4jContext.java | Nd4jContext.updateProperties | public void updateProperties(InputStream inputStream) {
try {
conf.load(inputStream);
conf.putAll(System.getProperties());
} catch (IOException e) {
log.warn("Error loading system properties from input stream", e);
}
} | java | public void updateProperties(InputStream inputStream) {
try {
conf.load(inputStream);
conf.putAll(System.getProperties());
} catch (IOException e) {
log.warn("Error loading system properties from input stream", e);
}
} | [
"public",
"void",
"updateProperties",
"(",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"conf",
".",
"load",
"(",
"inputStream",
")",
";",
"conf",
".",
"putAll",
"(",
"System",
".",
"getProperties",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IOExcept... | Load the additional properties from an input stream and load all system properties
@param inputStream | [
"Load",
"the",
"additional",
"properties",
"from",
"an",
"input",
"stream",
"and",
"load",
"all",
"system",
"properties"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-context/src/main/java/org/nd4j/context/Nd4jContext.java#L51-L58 |
128,817 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/descriptors/tensorflow/TensorflowDescriptorParser.java | TensorflowDescriptorParser.opDescs | public static synchronized Map<String,OpDef> opDescs() {
if(DESCRIPTORS != null){
return DESCRIPTORS;
}
try (InputStream contents = new ClassPathResource("ops.proto").getInputStream(); BufferedInputStream bis2 = new BufferedInputStream(contents); BufferedReader reader = new Buffered... | java | public static synchronized Map<String,OpDef> opDescs() {
if(DESCRIPTORS != null){
return DESCRIPTORS;
}
try (InputStream contents = new ClassPathResource("ops.proto").getInputStream(); BufferedInputStream bis2 = new BufferedInputStream(contents); BufferedReader reader = new Buffered... | [
"public",
"static",
"synchronized",
"Map",
"<",
"String",
",",
"OpDef",
">",
"opDescs",
"(",
")",
"{",
"if",
"(",
"DESCRIPTORS",
"!=",
"null",
")",
"{",
"return",
"DESCRIPTORS",
";",
"}",
"try",
"(",
"InputStream",
"contents",
"=",
"new",
"ClassPathResourc... | Get the op descriptors for tensorflow
@return the op descriptors for tensorflow
@throws Exception | [
"Get",
"the",
"op",
"descriptors",
"for",
"tensorflow"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/descriptors/tensorflow/TensorflowDescriptorParser.java#L41-L69 |
128,818 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/messages/requests/VectorRequestMessage.java | VectorRequestMessage.processMessage | @Override
public void processMessage() {
VectorAggregation aggregation = new VectorAggregation(rowIndex, (short) voidConfiguration.getNumberOfShards(),
getShardIndex(), storage.getArray(key).getRow(rowIndex).dup());
aggregation.setOriginatorId(this.getOriginatorId());
... | java | @Override
public void processMessage() {
VectorAggregation aggregation = new VectorAggregation(rowIndex, (short) voidConfiguration.getNumberOfShards(),
getShardIndex(), storage.getArray(key).getRow(rowIndex).dup());
aggregation.setOriginatorId(this.getOriginatorId());
... | [
"@",
"Override",
"public",
"void",
"processMessage",
"(",
")",
"{",
"VectorAggregation",
"aggregation",
"=",
"new",
"VectorAggregation",
"(",
"rowIndex",
",",
"(",
"short",
")",
"voidConfiguration",
".",
"getNumberOfShards",
"(",
")",
",",
"getShardIndex",
"(",
... | This message is possible to get only as Shard | [
"This",
"message",
"is",
"possible",
"to",
"get",
"only",
"as",
"Shard"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/messages/requests/VectorRequestMessage.java#L63-L80 |
128,819 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui/src/main/java/org/deeplearning4j/ui/weights/ConvolutionalIterationListener.java | ConvolutionalIterationListener.restoreRGBImage | private BufferedImage restoreRGBImage(INDArray tensor3D) {
INDArray arrayR = null;
INDArray arrayG = null;
INDArray arrayB = null;
// entry for 3D input vis
if (tensor3D.shape()[0] == 3) {
arrayR = tensor3D.tensorAlongDimension(2, 2, 1);
arrayG = tensor3D... | java | private BufferedImage restoreRGBImage(INDArray tensor3D) {
INDArray arrayR = null;
INDArray arrayG = null;
INDArray arrayB = null;
// entry for 3D input vis
if (tensor3D.shape()[0] == 3) {
arrayR = tensor3D.tensorAlongDimension(2, 2, 1);
arrayG = tensor3D... | [
"private",
"BufferedImage",
"restoreRGBImage",
"(",
"INDArray",
"tensor3D",
")",
"{",
"INDArray",
"arrayR",
"=",
"null",
";",
"INDArray",
"arrayG",
"=",
"null",
";",
"INDArray",
"arrayB",
"=",
"null",
";",
"// entry for 3D input vis",
"if",
"(",
"tensor3D",
".",... | Returns RGB image out of 3D tensor
@param tensor3D
@return | [
"Returns",
"RGB",
"image",
"out",
"of",
"3D",
"tensor"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui/src/main/java/org/deeplearning4j/ui/weights/ConvolutionalIterationListener.java#L611-L639 |
128,820 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui/src/main/java/org/deeplearning4j/ui/weights/ConvolutionalIterationListener.java | ConvolutionalIterationListener.renderImageGrayscale | private BufferedImage renderImageGrayscale(INDArray array) {
BufferedImage imageToRender = new BufferedImage(array.columns(), array.rows(), BufferedImage.TYPE_BYTE_GRAY);
for (int x = 0; x < array.columns(); x++) {
for (int y = 0; y < array.rows(); y++) {
imageToRender.getRas... | java | private BufferedImage renderImageGrayscale(INDArray array) {
BufferedImage imageToRender = new BufferedImage(array.columns(), array.rows(), BufferedImage.TYPE_BYTE_GRAY);
for (int x = 0; x < array.columns(); x++) {
for (int y = 0; y < array.rows(); y++) {
imageToRender.getRas... | [
"private",
"BufferedImage",
"renderImageGrayscale",
"(",
"INDArray",
"array",
")",
"{",
"BufferedImage",
"imageToRender",
"=",
"new",
"BufferedImage",
"(",
"array",
".",
"columns",
"(",
")",
",",
"array",
".",
"rows",
"(",
")",
",",
"BufferedImage",
".",
"TYPE... | Renders 2D INDArray into BufferedImage
@param array | [
"Renders",
"2D",
"INDArray",
"into",
"BufferedImage"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui/src/main/java/org/deeplearning4j/ui/weights/ConvolutionalIterationListener.java#L646-L655 |
128,821 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java | Text.append | public void append(byte[] utf8, int start, int len) {
setCapacity(length + len, true);
System.arraycopy(utf8, start, bytes, length, len);
length += len;
} | java | public void append(byte[] utf8, int start, int len) {
setCapacity(length + len, true);
System.arraycopy(utf8, start, bytes, length, len);
length += len;
} | [
"public",
"void",
"append",
"(",
"byte",
"[",
"]",
"utf8",
",",
"int",
"start",
",",
"int",
"len",
")",
"{",
"setCapacity",
"(",
"length",
"+",
"len",
",",
"true",
")",
";",
"System",
".",
"arraycopy",
"(",
"utf8",
",",
"start",
",",
"bytes",
",",
... | Append a range of bytes to the end of the given text
@param utf8 the data to copy from
@param start the first position to append from utf8
@param len the number of bytes to append | [
"Append",
"a",
"range",
"of",
"bytes",
"to",
"the",
"end",
"of",
"the",
"given",
"text"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java#L211-L215 |
128,822 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java | Text.write | public void write(DataOutput out) throws IOException {
WritableUtils.writeVInt(out, length);
out.write(bytes, 0, length);
} | java | public void write(DataOutput out) throws IOException {
WritableUtils.writeVInt(out, length);
out.write(bytes, 0, length);
} | [
"public",
"void",
"write",
"(",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"WritableUtils",
".",
"writeVInt",
"(",
"out",
",",
"length",
")",
";",
"out",
".",
"write",
"(",
"bytes",
",",
"0",
",",
"length",
")",
";",
"}"
] | serialize
write this object to out
length uses zero-compressed encoding
@see Writable#write(DataOutput) | [
"serialize",
"write",
"this",
"object",
"to",
"out",
"length",
"uses",
"zero",
"-",
"compressed",
"encoding"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java#L281-L284 |
128,823 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java | Text.validateUTF8 | public static void validateUTF8(byte[] utf8, int start, int len) throws MalformedInputException {
int count = start;
int leadByte = 0;
int length = 0;
int state = LEAD_BYTE;
while (count < start + len) {
int aByte = ((int) utf8[count] & 0xFF);
switch (sta... | java | public static void validateUTF8(byte[] utf8, int start, int len) throws MalformedInputException {
int count = start;
int leadByte = 0;
int length = 0;
int state = LEAD_BYTE;
while (count < start + len) {
int aByte = ((int) utf8[count] & 0xFF);
switch (sta... | [
"public",
"static",
"void",
"validateUTF8",
"(",
"byte",
"[",
"]",
"utf8",
",",
"int",
"start",
",",
"int",
"len",
")",
"throws",
"MalformedInputException",
"{",
"int",
"count",
"=",
"start",
";",
"int",
"leadByte",
"=",
"0",
";",
"int",
"length",
"=",
... | Check to see if a byte array is valid utf-8
@param utf8 the array of bytes
@param start the offset of the first byte in the array
@param len the length of the byte sequence
@throws MalformedInputException if the byte array contains invalid bytes | [
"Check",
"to",
"see",
"if",
"a",
"byte",
"array",
"is",
"valid",
"utf",
"-",
"8"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java#L431-L493 |
128,824 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java | Text.bytesToCodePoint | public static int bytesToCodePoint(ByteBuffer bytes) {
bytes.mark();
byte b = bytes.get();
bytes.reset();
int extraBytesToRead = bytesFromUTF8[(b & 0xFF)];
if (extraBytesToRead < 0)
return -1; // trailing byte!
int ch = 0;
switch (extraBytesToRead) {
... | java | public static int bytesToCodePoint(ByteBuffer bytes) {
bytes.mark();
byte b = bytes.get();
bytes.reset();
int extraBytesToRead = bytesFromUTF8[(b & 0xFF)];
if (extraBytesToRead < 0)
return -1; // trailing byte!
int ch = 0;
switch (extraBytesToRead) {
... | [
"public",
"static",
"int",
"bytesToCodePoint",
"(",
"ByteBuffer",
"bytes",
")",
"{",
"bytes",
".",
"mark",
"(",
")",
";",
"byte",
"b",
"=",
"bytes",
".",
"get",
"(",
")",
";",
"bytes",
".",
"reset",
"(",
")",
";",
"int",
"extraBytesToRead",
"=",
"byt... | Returns the next code point at the current position in
the buffer. The buffer's position will be incremented.
Any mark set on this buffer will be changed by this method! | [
"Returns",
"the",
"next",
"code",
"point",
"at",
"the",
"current",
"position",
"in",
"the",
"buffer",
".",
"The",
"buffer",
"s",
"position",
"will",
"be",
"incremented",
".",
"Any",
"mark",
"set",
"on",
"this",
"buffer",
"will",
"be",
"changed",
"by",
"t... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java#L519-L550 |
128,825 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java | Text.utf8Length | public static int utf8Length(String string) {
CharacterIterator iter = new StringCharacterIterator(string);
char ch = iter.first();
int size = 0;
while (ch != CharacterIterator.DONE) {
if ((ch >= 0xD800) && (ch < 0xDC00)) {
// surrogate pair?
c... | java | public static int utf8Length(String string) {
CharacterIterator iter = new StringCharacterIterator(string);
char ch = iter.first();
int size = 0;
while (ch != CharacterIterator.DONE) {
if ((ch >= 0xD800) && (ch < 0xDC00)) {
// surrogate pair?
c... | [
"public",
"static",
"int",
"utf8Length",
"(",
"String",
"string",
")",
"{",
"CharacterIterator",
"iter",
"=",
"new",
"StringCharacterIterator",
"(",
"string",
")",
";",
"char",
"ch",
"=",
"iter",
".",
"first",
"(",
")",
";",
"int",
"size",
"=",
"0",
";",... | For the given string, returns the number of UTF-8 bytes
required to encode the string.
@param string text to encode
@return number of UTF-8 bytes required to encode | [
"For",
"the",
"given",
"string",
"returns",
"the",
"number",
"of",
"UTF",
"-",
"8",
"bytes",
"required",
"to",
"encode",
"the",
"string",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/Text.java#L561-L588 |
128,826 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/MemoryTracker.java | MemoryTracker.getApproximateFreeMemory | public long getApproximateFreeMemory(int deviceId) {
val externalAllocations = getTotalMemory(deviceId) - getFreeMemory(deviceId);
val active = getActiveMemory(deviceId);
val free = getTotalMemory(deviceId) - (active + externalAllocations);
return free;
} | java | public long getApproximateFreeMemory(int deviceId) {
val externalAllocations = getTotalMemory(deviceId) - getFreeMemory(deviceId);
val active = getActiveMemory(deviceId);
val free = getTotalMemory(deviceId) - (active + externalAllocations);
return free;
} | [
"public",
"long",
"getApproximateFreeMemory",
"(",
"int",
"deviceId",
")",
"{",
"val",
"externalAllocations",
"=",
"getTotalMemory",
"(",
"deviceId",
")",
"-",
"getFreeMemory",
"(",
"deviceId",
")",
";",
"val",
"active",
"=",
"getActiveMemory",
"(",
"deviceId",
... | This method returns approximate free memory on specified device
@param deviceId
@return | [
"This",
"method",
"returns",
"approximate",
"free",
"memory",
"on",
"specified",
"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/MemoryTracker.java#L108-L113 |
128,827 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/MemoryTracker.java | MemoryTracker.getPreciseFreeMemory | public long getPreciseFreeMemory(int deviceId) {
// we refresh free memory on device
val extFree = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceFreeMemory(deviceId);
//freePerDevice.get(deviceId).set(extFree);
return extFree;
} | java | public long getPreciseFreeMemory(int deviceId) {
// we refresh free memory on device
val extFree = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceFreeMemory(deviceId);
//freePerDevice.get(deviceId).set(extFree);
return extFree;
} | [
"public",
"long",
"getPreciseFreeMemory",
"(",
"int",
"deviceId",
")",
"{",
"// we refresh free memory on device",
"val",
"extFree",
"=",
"NativeOpsHolder",
".",
"getInstance",
"(",
")",
".",
"getDeviceNativeOps",
"(",
")",
".",
"getDeviceFreeMemory",
"(",
"deviceId",... | This method returns precise amount of free memory on specified device
@param deviceId
@return | [
"This",
"method",
"returns",
"precise",
"amount",
"of",
"free",
"memory",
"on",
"specified",
"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/MemoryTracker.java#L120-L126 |
128,828 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java | SparseBaseLevel1.nrm2 | @Override
public double nrm2(INDArray arr) {
switch (arr.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(DataType.DOUBLE, arr);
return dnrm2(arr.length(), arr, 1);
case FLOAT:
DefaultOpExecutioner.validateDataTy... | java | @Override
public double nrm2(INDArray arr) {
switch (arr.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(DataType.DOUBLE, arr);
return dnrm2(arr.length(), arr, 1);
case FLOAT:
DefaultOpExecutioner.validateDataTy... | [
"@",
"Override",
"public",
"double",
"nrm2",
"(",
"INDArray",
"arr",
")",
"{",
"switch",
"(",
"arr",
".",
"data",
"(",
")",
".",
"dataType",
"(",
")",
")",
"{",
"case",
"DOUBLE",
":",
"DefaultOpExecutioner",
".",
"validateDataType",
"(",
"DataType",
".",... | Computes the Euclidean norm of a vector.
@param arr a vector
@return the Euclidean norm of the vector | [
"Computes",
"the",
"Euclidean",
"norm",
"of",
"a",
"vector",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java#L75-L90 |
128,829 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java | SparseBaseLevel1.asum | @Override
public double asum(INDArray arr) {
switch (arr.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(DataType.DOUBLE, arr);
return dasum(arr.length(), arr, 1);
case FLOAT:
DefaultOpExecutioner.validateDataTy... | java | @Override
public double asum(INDArray arr) {
switch (arr.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(DataType.DOUBLE, arr);
return dasum(arr.length(), arr, 1);
case FLOAT:
DefaultOpExecutioner.validateDataTy... | [
"@",
"Override",
"public",
"double",
"asum",
"(",
"INDArray",
"arr",
")",
"{",
"switch",
"(",
"arr",
".",
"data",
"(",
")",
".",
"dataType",
"(",
")",
")",
"{",
"case",
"DOUBLE",
":",
"DefaultOpExecutioner",
".",
"validateDataType",
"(",
"DataType",
".",... | Compute the sum of magnitude of the vector elements
@param arr a vector
@return the sum of magnitude of the vector elements | [
"Compute",
"the",
"sum",
"of",
"magnitude",
"of",
"the",
"vector",
"elements"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java#L98-L114 |
128,830 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java | SparseBaseLevel1.iamin | @Override
public int iamin(INDArray arr) {
switch (arr.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(DataType.DOUBLE, arr);
return idamin(arr.length(), arr, 1);
case FLOAT:
DefaultOpExecutioner.validateDataType... | java | @Override
public int iamin(INDArray arr) {
switch (arr.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(DataType.DOUBLE, arr);
return idamin(arr.length(), arr, 1);
case FLOAT:
DefaultOpExecutioner.validateDataType... | [
"@",
"Override",
"public",
"int",
"iamin",
"(",
"INDArray",
"arr",
")",
"{",
"switch",
"(",
"arr",
".",
"data",
"(",
")",
".",
"dataType",
"(",
")",
")",
"{",
"case",
"DOUBLE",
":",
"DefaultOpExecutioner",
".",
"validateDataType",
"(",
"DataType",
".",
... | Find the index of the element with maximum absolute value
@param arr a vector
@return the index of the element with minimum absolute value | [
"Find",
"the",
"index",
"of",
"the",
"element",
"with",
"maximum",
"absolute",
"value"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java#L162-L177 |
128,831 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java | SparseBaseLevel1.axpy | @Override
public void axpy(long n, double alpha, INDArray x, INDArray y) {
BaseSparseNDArray sparseX = (BaseSparseNDArray) x;
DataBuffer pointers = sparseX.getVectorCoordinates();
switch (x.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(Da... | java | @Override
public void axpy(long n, double alpha, INDArray x, INDArray y) {
BaseSparseNDArray sparseX = (BaseSparseNDArray) x;
DataBuffer pointers = sparseX.getVectorCoordinates();
switch (x.data().dataType()) {
case DOUBLE:
DefaultOpExecutioner.validateDataType(Da... | [
"@",
"Override",
"public",
"void",
"axpy",
"(",
"long",
"n",
",",
"double",
"alpha",
",",
"INDArray",
"x",
",",
"INDArray",
"y",
")",
"{",
"BaseSparseNDArray",
"sparseX",
"=",
"(",
"BaseSparseNDArray",
")",
"x",
";",
"DataBuffer",
"pointers",
"=",
"sparseX... | Adds a scalar multiple of compressed sparse vector to a full-storage vector.
@param n The number of element
@param alpha
@param x a sparse vector
@param y a dense vector | [
"Adds",
"a",
"scalar",
"multiple",
"of",
"compressed",
"sparse",
"vector",
"to",
"a",
"full",
"-",
"storage",
"vector",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java#L204-L227 |
128,832 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java | SparseBaseLevel1.scal | @Override
public void scal(long N, double alpha, INDArray X) {
switch (X.data().dataType()) {
case DOUBLE:
dscal(N, alpha, X, 1);
break;
case FLOAT:
sscal(N, alpha, X, 1);
break;
case HALF:
hs... | java | @Override
public void scal(long N, double alpha, INDArray X) {
switch (X.data().dataType()) {
case DOUBLE:
dscal(N, alpha, X, 1);
break;
case FLOAT:
sscal(N, alpha, X, 1);
break;
case HALF:
hs... | [
"@",
"Override",
"public",
"void",
"scal",
"(",
"long",
"N",
",",
"double",
"alpha",
",",
"INDArray",
"X",
")",
"{",
"switch",
"(",
"X",
".",
"data",
"(",
")",
".",
"dataType",
"(",
")",
")",
"{",
"case",
"DOUBLE",
":",
"dscal",
"(",
"N",
",",
... | Computes the product of a vector by a scalar.
@param N The number of elements of the vector X
@param alpha a scalar
@param X a vector | [
"Computes",
"the",
"product",
"of",
"a",
"vector",
"by",
"a",
"scalar",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/SparseBaseLevel1.java#L286-L302 |
128,833 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/ui/HtmlAnalysis.java | HtmlAnalysis.createHtmlAnalysisFile | public static void createHtmlAnalysisFile(DataAnalysis dataAnalysis, File output) throws Exception {
String str = createHtmlAnalysisString(dataAnalysis);
FileUtils.writeStringToFile(output, str, StandardCharsets.UTF_8);
} | java | public static void createHtmlAnalysisFile(DataAnalysis dataAnalysis, File output) throws Exception {
String str = createHtmlAnalysisString(dataAnalysis);
FileUtils.writeStringToFile(output, str, StandardCharsets.UTF_8);
} | [
"public",
"static",
"void",
"createHtmlAnalysisFile",
"(",
"DataAnalysis",
"dataAnalysis",
",",
"File",
"output",
")",
"throws",
"Exception",
"{",
"String",
"str",
"=",
"createHtmlAnalysisString",
"(",
"dataAnalysis",
")",
";",
"FileUtils",
".",
"writeStringToFile",
... | Render a data analysis object as a HTML file. This will produce a summary table, along charts for
numerical columns
@param dataAnalysis Data analysis object to render
@param output Output file (should have extension .html) | [
"Render",
"a",
"data",
"analysis",
"object",
"as",
"a",
"HTML",
"file",
".",
"This",
"will",
"produce",
"a",
"summary",
"table",
"along",
"charts",
"for",
"numerical",
"columns"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/ui/HtmlAnalysis.java#L234-L239 |
128,834 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/recordreader/BaseImageRecordReader.java | BaseImageRecordReader.getLabel | public String getLabel(String path) {
if (labelGenerator != null) {
return labelGenerator.getLabelForPath(path).toString();
}
if (fileNameMap != null && fileNameMap.containsKey(path))
return fileNameMap.get(path);
return (new File(path)).getParentFile().getName();... | java | public String getLabel(String path) {
if (labelGenerator != null) {
return labelGenerator.getLabelForPath(path).toString();
}
if (fileNameMap != null && fileNameMap.containsKey(path))
return fileNameMap.get(path);
return (new File(path)).getParentFile().getName();... | [
"public",
"String",
"getLabel",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"labelGenerator",
"!=",
"null",
")",
"{",
"return",
"labelGenerator",
".",
"getLabelForPath",
"(",
"path",
")",
".",
"toString",
"(",
")",
";",
"}",
"if",
"(",
"fileNameMap",
"!=... | Get the label from the given path
@param path the path to get the label from
@return the label for the given path | [
"Get",
"the",
"label",
"from",
"the",
"given",
"path"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/recordreader/BaseImageRecordReader.java#L409-L416 |
128,835 | deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/recordreader/BaseImageRecordReader.java | BaseImageRecordReader.accumulateLabel | protected void accumulateLabel(String path) {
String name = getLabel(path);
if (!labels.contains(name))
labels.add(name);
} | java | protected void accumulateLabel(String path) {
String name = getLabel(path);
if (!labels.contains(name))
labels.add(name);
} | [
"protected",
"void",
"accumulateLabel",
"(",
"String",
"path",
")",
"{",
"String",
"name",
"=",
"getLabel",
"(",
"path",
")",
";",
"if",
"(",
"!",
"labels",
".",
"contains",
"(",
"name",
")",
")",
"labels",
".",
"add",
"(",
"name",
")",
";",
"}"
] | Accumulate the label from the path
@param path the path to get the label from | [
"Accumulate",
"the",
"label",
"from",
"the",
"path"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/recordreader/BaseImageRecordReader.java#L423-L427 |
128,836 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java | Eigen.symmetricGeneralizedEigenvalues | public static INDArray symmetricGeneralizedEigenvalues(INDArray A, boolean calculateVectors) {
INDArray eigenvalues = Nd4j.create(A.rows());
Nd4j.getBlasWrapper().syev('V', 'L', (calculateVectors ? A : A.dup()), eigenvalues);
return eigenvalues;
} | java | public static INDArray symmetricGeneralizedEigenvalues(INDArray A, boolean calculateVectors) {
INDArray eigenvalues = Nd4j.create(A.rows());
Nd4j.getBlasWrapper().syev('V', 'L', (calculateVectors ? A : A.dup()), eigenvalues);
return eigenvalues;
} | [
"public",
"static",
"INDArray",
"symmetricGeneralizedEigenvalues",
"(",
"INDArray",
"A",
",",
"boolean",
"calculateVectors",
")",
"{",
"INDArray",
"eigenvalues",
"=",
"Nd4j",
".",
"create",
"(",
"A",
".",
"rows",
"(",
")",
")",
";",
"Nd4j",
".",
"getBlasWrappe... | Compute generalized eigenvalues of the problem A x = L x.
Matrix A is modified in the process, holding eigenvectors as columns after execution.
@param A symmetric Matrix A. After execution, A will contain the eigenvectors as columns
@param calculateVectors if false, it will not modify A and calculate eigenvectors
@ret... | [
"Compute",
"generalized",
"eigenvalues",
"of",
"the",
"problem",
"A",
"x",
"=",
"L",
"x",
".",
"Matrix",
"A",
"is",
"modified",
"in",
"the",
"process",
"holding",
"eigenvectors",
"as",
"columns",
"after",
"execution",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java#L55-L59 |
128,837 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java | Eigen.symmetricGeneralizedEigenvalues | public static INDArray symmetricGeneralizedEigenvalues(INDArray A, INDArray B) {
Preconditions.checkArgument(A.isMatrix() && A.isSquare(), "Argument A must be a square matrix: has shape %s", A.shape());
Preconditions.checkArgument(B.isMatrix() && B.isSquare(), "Argument B must be a square matrix: has sh... | java | public static INDArray symmetricGeneralizedEigenvalues(INDArray A, INDArray B) {
Preconditions.checkArgument(A.isMatrix() && A.isSquare(), "Argument A must be a square matrix: has shape %s", A.shape());
Preconditions.checkArgument(B.isMatrix() && B.isSquare(), "Argument B must be a square matrix: has sh... | [
"public",
"static",
"INDArray",
"symmetricGeneralizedEigenvalues",
"(",
"INDArray",
"A",
",",
"INDArray",
"B",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"A",
".",
"isMatrix",
"(",
")",
"&&",
"A",
".",
"isSquare",
"(",
")",
",",
"\"Argument A must b... | Compute generalized eigenvalues of the problem A x = L B x.
The data will be unchanged, no eigenvectors returned.
@param A symmetric Matrix A.
@param B symmetric Matrix B.
@return a vector of eigenvalues L. | [
"Compute",
"generalized",
"eigenvalues",
"of",
"the",
"problem",
"A",
"x",
"=",
"L",
"B",
"x",
".",
"The",
"data",
"will",
"be",
"unchanged",
"no",
"eigenvectors",
"returned",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java#L70-L78 |
128,838 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/text/tokenization/tokenizer/DefaultStreamTokenizer.java | DefaultStreamTokenizer.streamHasMoreTokens | private boolean streamHasMoreTokens() {
if (streamTokenizer.ttype != StreamTokenizer.TT_EOF) {
try {
streamTokenizer.nextToken();
} catch (IOException e1) {
throw new RuntimeException(e1);
}
}
return streamTokenizer.ttype != Str... | java | private boolean streamHasMoreTokens() {
if (streamTokenizer.ttype != StreamTokenizer.TT_EOF) {
try {
streamTokenizer.nextToken();
} catch (IOException e1) {
throw new RuntimeException(e1);
}
}
return streamTokenizer.ttype != Str... | [
"private",
"boolean",
"streamHasMoreTokens",
"(",
")",
"{",
"if",
"(",
"streamTokenizer",
".",
"ttype",
"!=",
"StreamTokenizer",
".",
"TT_EOF",
")",
"{",
"try",
"{",
"streamTokenizer",
".",
"nextToken",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e1",
... | Checks, if underlying stream has any tokens left
@return | [
"Checks",
"if",
"underlying",
"stream",
"has",
"any",
"tokens",
"left"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/text/tokenization/tokenizer/DefaultStreamTokenizer.java#L53-L62 |
128,839 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/text/tokenization/tokenizer/DefaultStreamTokenizer.java | DefaultStreamTokenizer.hasMoreTokens | @Override
public boolean hasMoreTokens() {
log.info("Tokens size: [" + tokens.size() + "], position: [" + position.get() + "]");
if (!tokens.isEmpty())
return position.get() < tokens.size();
else
return streamHasMoreTokens();
} | java | @Override
public boolean hasMoreTokens() {
log.info("Tokens size: [" + tokens.size() + "], position: [" + position.get() + "]");
if (!tokens.isEmpty())
return position.get() < tokens.size();
else
return streamHasMoreTokens();
} | [
"@",
"Override",
"public",
"boolean",
"hasMoreTokens",
"(",
")",
"{",
"log",
".",
"info",
"(",
"\"Tokens size: [\"",
"+",
"tokens",
".",
"size",
"(",
")",
"+",
"\"], position: [\"",
"+",
"position",
".",
"get",
"(",
")",
"+",
"\"]\"",
")",
";",
"if",
"... | Checks, if any prebuffered tokens left, otherswise checks underlying stream
@return | [
"Checks",
"if",
"any",
"prebuffered",
"tokens",
"left",
"otherswise",
"checks",
"underlying",
"stream"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/text/tokenization/tokenizer/DefaultStreamTokenizer.java#L68-L75 |
128,840 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/text/tokenization/tokenizer/DefaultStreamTokenizer.java | DefaultStreamTokenizer.getTokens | @Override
public List<String> getTokens() {
//List<String> tokens = new ArrayList<>();
if (!tokens.isEmpty())
return tokens;
log.info("Starting prebuffering...");
while (streamHasMoreTokens()) {
tokens.add(nextTokenFromStream());
}
log.info("T... | java | @Override
public List<String> getTokens() {
//List<String> tokens = new ArrayList<>();
if (!tokens.isEmpty())
return tokens;
log.info("Starting prebuffering...");
while (streamHasMoreTokens()) {
tokens.add(nextTokenFromStream());
}
log.info("T... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"getTokens",
"(",
")",
"{",
"//List<String> tokens = new ArrayList<>();",
"if",
"(",
"!",
"tokens",
".",
"isEmpty",
"(",
")",
")",
"return",
"tokens",
";",
"log",
".",
"info",
"(",
"\"Starting prebuffering... | Returns all tokens as list of Strings
@return List of tokens | [
"Returns",
"all",
"tokens",
"as",
"list",
"of",
"Strings"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/text/tokenization/tokenizer/DefaultStreamTokenizer.java#L138-L150 |
128,841 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/transform/column/ReorderColumnsTransform.java | ReorderColumnsTransform.columnNames | @Override
public String[] columnNames() {
return getInputSchema().getColumnNames().toArray(new String[getInputSchema().getColumnNames().size()]);
} | java | @Override
public String[] columnNames() {
return getInputSchema().getColumnNames().toArray(new String[getInputSchema().getColumnNames().size()]);
} | [
"@",
"Override",
"public",
"String",
"[",
"]",
"columnNames",
"(",
")",
"{",
"return",
"getInputSchema",
"(",
")",
".",
"getColumnNames",
"(",
")",
".",
"toArray",
"(",
"new",
"String",
"[",
"getInputSchema",
"(",
")",
".",
"getColumnNames",
"(",
")",
".... | Returns column names
this op is meant to run on
@return | [
"Returns",
"column",
"names",
"this",
"op",
"is",
"meant",
"to",
"run",
"on"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/transform/column/ReorderColumnsTransform.java#L225-L228 |
128,842 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/legacy/AdaGrad.java | AdaGrad.getGradient | public INDArray getGradient(INDArray gradient, int iteration) {
if (historicalGradient == null)
throw new IllegalStateException("Updater has not been initialized with view state");
historicalGradient.addi(gradient.mul(gradient));
INDArray sqrtHistory = sqrt(historicalGradient.dup(g... | java | public INDArray getGradient(INDArray gradient, int iteration) {
if (historicalGradient == null)
throw new IllegalStateException("Updater has not been initialized with view state");
historicalGradient.addi(gradient.mul(gradient));
INDArray sqrtHistory = sqrt(historicalGradient.dup(g... | [
"public",
"INDArray",
"getGradient",
"(",
"INDArray",
"gradient",
",",
"int",
"iteration",
")",
"{",
"if",
"(",
"historicalGradient",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Updater has not been initialized with view state\"",
")",
";",
"hi... | Gets feature specific learning rates
Adagrad keeps a history of gradients being passed in.
Note that each gradient passed in becomes adapted over time, hence
the opName adagrad
@param gradient the gradient to get learning rates for
@param iteration
@return the feature specific learning rates | [
"Gets",
"feature",
"specific",
"learning",
"rates",
"Adagrad",
"keeps",
"a",
"history",
"of",
"gradients",
"being",
"passed",
"in",
".",
"Note",
"that",
"each",
"gradient",
"passed",
"in",
"becomes",
"adapted",
"over",
"time",
"hence",
"the",
"opName",
"adagra... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/legacy/AdaGrad.java#L114-L125 |
128,843 | deeplearning4j/deeplearning4j | rl4j/rl4j-malmo/src/main/java/org/deeplearning4j/malmo/MalmoEnv.java | MalmoEnv.loadMissionXML | public static MissionSpec loadMissionXML(String filename) {
MissionSpec mission = null;
try {
String xml = new String(Files.readAllBytes(Paths.get(filename)));
mission = new MissionSpec(xml, true);
} catch (Exception e) {
//e.printStackTrace();
thr... | java | public static MissionSpec loadMissionXML(String filename) {
MissionSpec mission = null;
try {
String xml = new String(Files.readAllBytes(Paths.get(filename)));
mission = new MissionSpec(xml, true);
} catch (Exception e) {
//e.printStackTrace();
thr... | [
"public",
"static",
"MissionSpec",
"loadMissionXML",
"(",
"String",
"filename",
")",
"{",
"MissionSpec",
"mission",
"=",
"null",
";",
"try",
"{",
"String",
"xml",
"=",
"new",
"String",
"(",
"Files",
".",
"readAllBytes",
"(",
"Paths",
".",
"get",
"(",
"file... | Convenience method to load a Malmo mission specification from an XML-file
@param filename name of XML file
@return Mission specification loaded from XML-file | [
"Convenience",
"method",
"to",
"load",
"a",
"Malmo",
"mission",
"specification",
"from",
"an",
"XML",
"-",
"file"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/rl4j/rl4j-malmo/src/main/java/org/deeplearning4j/malmo/MalmoEnv.java#L140-L151 |
128,844 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java | CudaDataBufferFactory.createDouble | @Override
public DataBuffer createDouble(double[] data, boolean copy, MemoryWorkspace workspace) {
return new CudaDoubleDataBuffer(data, copy, workspace);
} | java | @Override
public DataBuffer createDouble(double[] data, boolean copy, MemoryWorkspace workspace) {
return new CudaDoubleDataBuffer(data, copy, workspace);
} | [
"@",
"Override",
"public",
"DataBuffer",
"createDouble",
"(",
"double",
"[",
"]",
"data",
",",
"boolean",
"copy",
",",
"MemoryWorkspace",
"workspace",
")",
"{",
"return",
"new",
"CudaDoubleDataBuffer",
"(",
"data",
",",
"copy",
",",
"workspace",
")",
";",
"}... | Creates a double data buffer
@param data the data to create the buffer from
@param copy
@param workspace @return the new buffer | [
"Creates",
"a",
"double",
"data",
"buffer"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java#L840-L843 |
128,845 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/formats/input/impl/ListStringInputFormat.java | ListStringInputFormat.createReader | @Override
public RecordReader createReader(InputSplit split) throws IOException, InterruptedException {
RecordReader reader = new ListStringRecordReader();
reader.initialize(split);
return reader;
} | java | @Override
public RecordReader createReader(InputSplit split) throws IOException, InterruptedException {
RecordReader reader = new ListStringRecordReader();
reader.initialize(split);
return reader;
} | [
"@",
"Override",
"public",
"RecordReader",
"createReader",
"(",
"InputSplit",
"split",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"RecordReader",
"reader",
"=",
"new",
"ListStringRecordReader",
"(",
")",
";",
"reader",
".",
"initialize",
"(",
... | Creates a reader from an input split
@param split the split to read
@return the reader from the given input split | [
"Creates",
"a",
"reader",
"from",
"an",
"input",
"split"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/formats/input/impl/ListStringInputFormat.java#L55-L60 |
128,846 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/SubGraphPredicate.java | SubGraphPredicate.matches | public boolean matches(SameDiff sameDiff, DifferentialFunction rootFn){
if(!root.matches(sameDiff, rootFn)){
return false;
}
SDVariable[] inputs = rootFn.args();
int inCount = inputs == null ? 0 : inputs.length;
if(inputCount != null){
if(inCount != this... | java | public boolean matches(SameDiff sameDiff, DifferentialFunction rootFn){
if(!root.matches(sameDiff, rootFn)){
return false;
}
SDVariable[] inputs = rootFn.args();
int inCount = inputs == null ? 0 : inputs.length;
if(inputCount != null){
if(inCount != this... | [
"public",
"boolean",
"matches",
"(",
"SameDiff",
"sameDiff",
",",
"DifferentialFunction",
"rootFn",
")",
"{",
"if",
"(",
"!",
"root",
".",
"matches",
"(",
"sameDiff",
",",
"rootFn",
")",
")",
"{",
"return",
"false",
";",
"}",
"SDVariable",
"[",
"]",
"inp... | Determine if the subgraph, starting with the root function, matches the predicate
@param sameDiff SameDiff instance the function belongs to
@param rootFn Function that defines the root of the subgraph
@return True if the subgraph mathes the predicate | [
"Determine",
"if",
"the",
"subgraph",
"starting",
"with",
"the",
"root",
"function",
"matches",
"the",
"predicate"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/SubGraphPredicate.java#L52-L88 |
128,847 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/SubGraphPredicate.java | SubGraphPredicate.getSubGraph | public SubGraph getSubGraph(SameDiff sd, DifferentialFunction rootFn){
Preconditions.checkState(matches(sd, rootFn), "Root function does not match predicate");
List<DifferentialFunction> childNodes = new ArrayList<>();
//Need to work out child nodes
if(!opInputSubgraphPredicates.isEmpty... | java | public SubGraph getSubGraph(SameDiff sd, DifferentialFunction rootFn){
Preconditions.checkState(matches(sd, rootFn), "Root function does not match predicate");
List<DifferentialFunction> childNodes = new ArrayList<>();
//Need to work out child nodes
if(!opInputSubgraphPredicates.isEmpty... | [
"public",
"SubGraph",
"getSubGraph",
"(",
"SameDiff",
"sd",
",",
"DifferentialFunction",
"rootFn",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"matches",
"(",
"sd",
",",
"rootFn",
")",
",",
"\"Root function does not match predicate\"",
")",
";",
"List",
"<"... | Get the SubGraph that matches the predicate
@param sd SameDiff instance the function belongs to
@param rootFn Function that defines the root of the subgraph
@return The subgraph that matches the predicate | [
"Get",
"the",
"SubGraph",
"that",
"matches",
"the",
"predicate"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/SubGraphPredicate.java#L97-L125 |
128,848 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/Ec2BoxCreator.java | Ec2BoxCreator.create | public void create() {
RunInstancesRequest runInstancesRequest =
new RunInstancesRequest().withImageId(amiId).withInstanceType(size).withKeyName(keyPair)
.withMinCount(1).withSecurityGroupIds(securityGroupId).withMaxCount(numBoxes);
AmazonE... | java | public void create() {
RunInstancesRequest runInstancesRequest =
new RunInstancesRequest().withImageId(amiId).withInstanceType(size).withKeyName(keyPair)
.withMinCount(1).withSecurityGroupIds(securityGroupId).withMaxCount(numBoxes);
AmazonE... | [
"public",
"void",
"create",
"(",
")",
"{",
"RunInstancesRequest",
"runInstancesRequest",
"=",
"new",
"RunInstancesRequest",
"(",
")",
".",
"withImageId",
"(",
"amiId",
")",
".",
"withInstanceType",
"(",
"size",
")",
".",
"withKeyName",
"(",
"keyPair",
")",
"."... | Create the instances | [
"Create",
"the",
"instances"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/Ec2BoxCreator.java#L128-L150 |
128,849 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/sptree/SpTree.java | SpTree.subDivide | public void subDivide() {
MemoryWorkspace workspace =
workspaceMode == WorkspaceMode.NONE ? new DummyWorkspace()
: Nd4j.getWorkspaceManager().getWorkspaceForCurrentThread(
workspaceConfigurationExternal,
workspaceExternal);
... | java | public void subDivide() {
MemoryWorkspace workspace =
workspaceMode == WorkspaceMode.NONE ? new DummyWorkspace()
: Nd4j.getWorkspaceManager().getWorkspaceForCurrentThread(
workspaceConfigurationExternal,
workspaceExternal);
... | [
"public",
"void",
"subDivide",
"(",
")",
"{",
"MemoryWorkspace",
"workspace",
"=",
"workspaceMode",
"==",
"WorkspaceMode",
".",
"NONE",
"?",
"new",
"DummyWorkspace",
"(",
")",
":",
"Nd4j",
".",
"getWorkspaceManager",
"(",
")",
".",
"getWorkspaceForCurrentThread",
... | Subdivide the node in to
4 children | [
"Subdivide",
"the",
"node",
"in",
"to",
"4",
"children"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/sptree/SpTree.java#L215-L254 |
128,850 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasActivationUtils.java | KerasActivationUtils.getIActivationFromConfig | public static IActivation getIActivationFromConfig(Map<String, Object> layerConfig, KerasLayerConfiguration conf)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
return getActivationFromConfig(layerConfig, conf).getActivationFunction();
} | java | public static IActivation getIActivationFromConfig(Map<String, Object> layerConfig, KerasLayerConfiguration conf)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
return getActivationFromConfig(layerConfig, conf).getActivationFunction();
} | [
"public",
"static",
"IActivation",
"getIActivationFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
",",
"KerasLayerConfiguration",
"conf",
")",
"throws",
"InvalidKerasConfigurationException",
",",
"UnsupportedKerasConfigurationException",
"{",
"ret... | Get activation function from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return DL4J activation function
@throws InvalidKerasConfigurationException Invalid Keras config
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Get",
"activation",
"function",
"from",
"Keras",
"layer",
"configuration",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasActivationUtils.java#L95-L98 |
128,851 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasActivationUtils.java | KerasActivationUtils.getActivationFromConfig | public static Activation getActivationFromConfig(Map<String, Object> layerConfig, KerasLayerConfiguration conf)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
... | java | public static Activation getActivationFromConfig(Map<String, Object> layerConfig, KerasLayerConfiguration conf)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
... | [
"public",
"static",
"Activation",
"getActivationFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
",",
"KerasLayerConfiguration",
"conf",
")",
"throws",
"InvalidKerasConfigurationException",
",",
"UnsupportedKerasConfigurationException",
"{",
"Map",... | Get activation enum value from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return DL4J activation enum value
@throws InvalidKerasConfigurationException Invalid Keras config
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Get",
"activation",
"enum",
"value",
"from",
"Keras",
"layer",
"configuration",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasActivationUtils.java#L108-L115 |
128,852 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper/src/main/java/org/deeplearning4j/parallelism/trainer/DefaultTrainer.java | DefaultTrainer.postInit | protected void postInit() {
Collection<TrainingListener> oldListeners = new ArrayList<>();
Collection<TrainingListener> replicatedListeners = new ArrayList<>();
if (parallelWrapper.getListeners() != null) {
oldListeners.addAll(parallelWrapper.getListeners());
}
confi... | java | protected void postInit() {
Collection<TrainingListener> oldListeners = new ArrayList<>();
Collection<TrainingListener> replicatedListeners = new ArrayList<>();
if (parallelWrapper.getListeners() != null) {
oldListeners.addAll(parallelWrapper.getListeners());
}
confi... | [
"protected",
"void",
"postInit",
"(",
")",
"{",
"Collection",
"<",
"TrainingListener",
">",
"oldListeners",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Collection",
"<",
"TrainingListener",
">",
"replicatedListeners",
"=",
"new",
"ArrayList",
"<>",
"(",
")"... | This method does post-initialization configuration of Model.
Good place to configure listeners and all such a things | [
"This",
"method",
"does",
"post",
"-",
"initialization",
"configuration",
"of",
"Model",
".",
"Good",
"place",
"to",
"configure",
"listeners",
"and",
"all",
"such",
"a",
"things"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper/src/main/java/org/deeplearning4j/parallelism/trainer/DefaultTrainer.java#L275-L285 |
128,853 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/impl/CudaCachingZeroProvider.java | CudaCachingZeroProvider.free | @Override
public void free(AllocationPoint point) {
if (point.getAllocationStatus() == AllocationStatus.DEVICE) {
super.free(point);
} else {
AllocationShape shape = point.getShape();
long reqMemory = AllocationUtils.getRequiredMemory(shape);
// we do... | java | @Override
public void free(AllocationPoint point) {
if (point.getAllocationStatus() == AllocationStatus.DEVICE) {
super.free(point);
} else {
AllocationShape shape = point.getShape();
long reqMemory = AllocationUtils.getRequiredMemory(shape);
// we do... | [
"@",
"Override",
"public",
"void",
"free",
"(",
"AllocationPoint",
"point",
")",
"{",
"if",
"(",
"point",
".",
"getAllocationStatus",
"(",
")",
"==",
"AllocationStatus",
".",
"DEVICE",
")",
"{",
"super",
".",
"free",
"(",
"point",
")",
";",
"}",
"else",
... | This method frees specific chunk of memory, described by AllocationPoint passed in.
PLEASE NOTE: This method can actually ignore free, and keep released memory chunk for future reuse.
@param point | [
"This",
"method",
"frees",
"specific",
"chunk",
"of",
"memory",
"described",
"by",
"AllocationPoint",
"passed",
"in",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/impl/CudaCachingZeroProvider.java#L167-L206 |
128,854 | deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.convertArrowVector | public static INDArray convertArrowVector(FieldVector fieldVector,ColumnType type) {
DataBuffer buffer = null;
int cols = fieldVector.getValueCount();
ByteBuffer direct = ByteBuffer.allocateDirect(fieldVector.getDataBuffer().capacity());
direct.order(ByteOrder.nativeOrder());
fie... | java | public static INDArray convertArrowVector(FieldVector fieldVector,ColumnType type) {
DataBuffer buffer = null;
int cols = fieldVector.getValueCount();
ByteBuffer direct = ByteBuffer.allocateDirect(fieldVector.getDataBuffer().capacity());
direct.order(ByteOrder.nativeOrder());
fie... | [
"public",
"static",
"INDArray",
"convertArrowVector",
"(",
"FieldVector",
"fieldVector",
",",
"ColumnType",
"type",
")",
"{",
"DataBuffer",
"buffer",
"=",
"null",
";",
"int",
"cols",
"=",
"fieldVector",
".",
"getValueCount",
"(",
")",
";",
"ByteBuffer",
"direct"... | Convert a field vector to a column vector
@param fieldVector the field vector to convert
@param type the type of the column vector
@return the converted ndarray | [
"Convert",
"a",
"field",
"vector",
"to",
"a",
"column",
"vector"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L171-L194 |
128,855 | deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.toArrowWritablesSingle | public static List<Writable> toArrowWritablesSingle(List<FieldVector> fieldVectors,Schema schema) {
return toArrowWritables(fieldVectors,schema).get(0);
} | java | public static List<Writable> toArrowWritablesSingle(List<FieldVector> fieldVectors,Schema schema) {
return toArrowWritables(fieldVectors,schema).get(0);
} | [
"public",
"static",
"List",
"<",
"Writable",
">",
"toArrowWritablesSingle",
"(",
"List",
"<",
"FieldVector",
">",
"fieldVectors",
",",
"Schema",
"schema",
")",
"{",
"return",
"toArrowWritables",
"(",
"fieldVectors",
",",
"schema",
")",
".",
"get",
"(",
"0",
... | Return a singular record based on the converted
writables result.
@param fieldVectors the field vectors to use
@param schema the schema to use for input
@return | [
"Return",
"a",
"singular",
"record",
"based",
"on",
"the",
"converted",
"writables",
"result",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L349-L351 |
128,856 | deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.field | public static Field field(String name,ArrowType arrowType) {
return new Field(name,FieldType.nullable(arrowType), new ArrayList<Field>());
} | java | public static Field field(String name,ArrowType arrowType) {
return new Field(name,FieldType.nullable(arrowType), new ArrayList<Field>());
} | [
"public",
"static",
"Field",
"field",
"(",
"String",
"name",
",",
"ArrowType",
"arrowType",
")",
"{",
"return",
"new",
"Field",
"(",
"name",
",",
"FieldType",
".",
"nullable",
"(",
"arrowType",
")",
",",
"new",
"ArrayList",
"<",
"Field",
">",
"(",
")",
... | Shortcut method for returning a field
given an arrow type and name
with no sub fields
@param name the name of the field
@param arrowType the arrow type of the field
@return the resulting field | [
"Shortcut",
"method",
"for",
"returning",
"a",
"field",
"given",
"an",
"arrow",
"type",
"and",
"name",
"with",
"no",
"sub",
"fields"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L458-L460 |
128,857 | deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.toArrowColumns | public static List<FieldVector> toArrowColumns(final BufferAllocator bufferAllocator, final Schema schema, List<List<Writable>> dataVecRecord) {
int numRows = dataVecRecord.size();
List<FieldVector> ret = createFieldVectors(bufferAllocator,schema,numRows);
for(int j = 0; j < schema.numColumns(... | java | public static List<FieldVector> toArrowColumns(final BufferAllocator bufferAllocator, final Schema schema, List<List<Writable>> dataVecRecord) {
int numRows = dataVecRecord.size();
List<FieldVector> ret = createFieldVectors(bufferAllocator,schema,numRows);
for(int j = 0; j < schema.numColumns(... | [
"public",
"static",
"List",
"<",
"FieldVector",
">",
"toArrowColumns",
"(",
"final",
"BufferAllocator",
"bufferAllocator",
",",
"final",
"Schema",
"schema",
",",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
"dataVecRecord",
")",
"{",
"int",
"numRows",
"=",
... | Given a buffer allocator and datavec schema,
convert the passed in batch of records
to a set of arrow columns
@param bufferAllocator the buffer allocator to use
@param schema the schema to convert
@param dataVecRecord the data vec record batch to convert
@return the converted list of {@link FieldVector} | [
"Given",
"a",
"buffer",
"allocator",
"and",
"datavec",
"schema",
"convert",
"the",
"passed",
"in",
"batch",
"of",
"records",
"to",
"a",
"set",
"of",
"arrow",
"columns"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L577-L594 |
128,858 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/LayerValidation.java | LayerValidation.assertNInNOutSet | public static void assertNInNOutSet(String layerType, String layerName, long layerIndex, long nIn, long nOut) {
if (nIn <= 0 || nOut <= 0) {
if (layerName == null)
layerName = "(name not set)";
throw new DL4JInvalidConfigException(layerType + " (index=" + layerIndex + ", ... | java | public static void assertNInNOutSet(String layerType, String layerName, long layerIndex, long nIn, long nOut) {
if (nIn <= 0 || nOut <= 0) {
if (layerName == null)
layerName = "(name not set)";
throw new DL4JInvalidConfigException(layerType + " (index=" + layerIndex + ", ... | [
"public",
"static",
"void",
"assertNInNOutSet",
"(",
"String",
"layerType",
",",
"String",
"layerName",
",",
"long",
"layerIndex",
",",
"long",
"nIn",
",",
"long",
"nOut",
")",
"{",
"if",
"(",
"nIn",
"<=",
"0",
"||",
"nOut",
"<=",
"0",
")",
"{",
"if",
... | Asserts that the layer nIn and nOut values are set for the layer
@param layerType Type of layer ("DenseLayer", etc)
@param layerName Name of the layer (may be null if not set)
@param layerIndex Index of the layer
@param nIn nIn value
@param nOut nOut value | [
"Asserts",
"that",
"the",
"layer",
"nIn",
"and",
"nOut",
"values",
"are",
"set",
"for",
"the",
"layer"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/LayerValidation.java#L50-L57 |
128,859 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/LayerValidation.java | LayerValidation.assertNOutSet | public static void assertNOutSet(String layerType, String layerName, long layerIndex, long nOut) {
if (nOut <= 0) {
if (layerName == null)
layerName = "(name not set)";
throw new DL4JInvalidConfigException(layerType + " (index=" + layerIndex + ", name=" + layerName + ") n... | java | public static void assertNOutSet(String layerType, String layerName, long layerIndex, long nOut) {
if (nOut <= 0) {
if (layerName == null)
layerName = "(name not set)";
throw new DL4JInvalidConfigException(layerType + " (index=" + layerIndex + ", name=" + layerName + ") n... | [
"public",
"static",
"void",
"assertNOutSet",
"(",
"String",
"layerType",
",",
"String",
"layerName",
",",
"long",
"layerIndex",
",",
"long",
"nOut",
")",
"{",
"if",
"(",
"nOut",
"<=",
"0",
")",
"{",
"if",
"(",
"layerName",
"==",
"null",
")",
"layerName",... | Asserts that the layer nOut value is set for the layer
@param layerType Type of layer ("DenseLayer", etc)
@param layerName Name of the layer (may be null if not set)
@param layerIndex Index of the layer
@param nOut nOut value | [
"Asserts",
"that",
"the",
"layer",
"nOut",
"value",
"is",
"set",
"for",
"the",
"layer"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/LayerValidation.java#L67-L74 |
128,860 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.jaccardDistance | public SDVariable jaccardDistance(SDVariable x, SDVariable y, int... dimensions) {
return jaccardDistance(null, x, y, dimensions);
} | java | public SDVariable jaccardDistance(SDVariable x, SDVariable y, int... dimensions) {
return jaccardDistance(null, x, y, dimensions);
} | [
"public",
"SDVariable",
"jaccardDistance",
"(",
"SDVariable",
"x",
",",
"SDVariable",
"y",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"jaccardDistance",
"(",
"null",
",",
"x",
",",
"y",
",",
"dimensions",
")",
";",
"}"
] | Jaccard similarity reduction operation. The output contains the Jaccard distance for each
tensor along the specified dimensions.
@param x Input variable x
@param y Input variable y
@param dimensions Dimensions to calculate Jaccard similarity over
@return Output variable | [
"Jaccard",
"similarity",
"reduction",
"operation",
".",
"The",
"output",
"contains",
"the",
"Jaccard",
"distance",
"for",
"each",
"tensor",
"along",
"the",
"specified",
"dimensions",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L1446-L1448 |
128,861 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java | SDMath.normalizeMoments | public SDVariable[] normalizeMoments(String[] name, SDVariable counts, SDVariable means, SDVariable variances,
double shift) {
SDVariable[] res = f().normalizeMoments(counts, means, variances, shift);
return sd.updateVariableNamesAndReferences(res, name);
} | java | public SDVariable[] normalizeMoments(String[] name, SDVariable counts, SDVariable means, SDVariable variances,
double shift) {
SDVariable[] res = f().normalizeMoments(counts, means, variances, shift);
return sd.updateVariableNamesAndReferences(res, name);
} | [
"public",
"SDVariable",
"[",
"]",
"normalizeMoments",
"(",
"String",
"[",
"]",
"name",
",",
"SDVariable",
"counts",
",",
"SDVariable",
"means",
",",
"SDVariable",
"variances",
",",
"double",
"shift",
")",
"{",
"SDVariable",
"[",
"]",
"res",
"=",
"f",
"(",
... | Calculate the mean and variance from the sufficient statistics
@param name Name of the output variables. Can be null; if non-null, must be length 2
@param counts Rank 0 (scalar) value with the total number of values used to calculate the sufficient statistics
@param means Mean-value sufficient statistics: ... | [
"Calculate",
"the",
"mean",
"and",
"variance",
"from",
"the",
"sufficient",
"statistics"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L1892-L1896 |
128,862 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/emr/SparkEMRClient.java | SparkEMRClient.createCluster | public void createCluster() {
AmazonElasticMapReduce emr = sparkEmrClientBuilder.build();
Optional<ClusterSummary> csr = findClusterWithName(emr, sparkClusterName);
if (csr.isPresent()) {
String msg = String.format("A cluster with name %s and id %s is already deployed", sparkClusterN... | java | public void createCluster() {
AmazonElasticMapReduce emr = sparkEmrClientBuilder.build();
Optional<ClusterSummary> csr = findClusterWithName(emr, sparkClusterName);
if (csr.isPresent()) {
String msg = String.format("A cluster with name %s and id %s is already deployed", sparkClusterN... | [
"public",
"void",
"createCluster",
"(",
")",
"{",
"AmazonElasticMapReduce",
"emr",
"=",
"sparkEmrClientBuilder",
".",
"build",
"(",
")",
";",
"Optional",
"<",
"ClusterSummary",
">",
"csr",
"=",
"findClusterWithName",
"(",
"emr",
",",
"sparkClusterName",
")",
";"... | Creates the current cluster | [
"Creates",
"the",
"current",
"cluster"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/emr/SparkEMRClient.java#L85-L98 |
128,863 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java | ParameterServerClient.isReadyForNext | public boolean isReadyForNext() {
if (objectMapper == null)
objectMapper = new ObjectMapper();
try {
int masterStream = Integer.parseInt(ndarraySendUrl.split(":")[2]);
SubscriberState subscriberState =
objectMapper.readValue(Unirest
... | java | public boolean isReadyForNext() {
if (objectMapper == null)
objectMapper = new ObjectMapper();
try {
int masterStream = Integer.parseInt(ndarraySendUrl.split(":")[2]);
SubscriberState subscriberState =
objectMapper.readValue(Unirest
... | [
"public",
"boolean",
"isReadyForNext",
"(",
")",
"{",
"if",
"(",
"objectMapper",
"==",
"null",
")",
"objectMapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"try",
"{",
"int",
"masterStream",
"=",
"Integer",
".",
"parseInt",
"(",
"ndarraySendUrl",
".",
"... | Returns true if the client is
ready for a next array or not
@return true if the client is
ready for the next array or not,false otherwise | [
"Returns",
"true",
"if",
"the",
"client",
"is",
"ready",
"for",
"a",
"next",
"array",
"or",
"not"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java#L125-L141 |
128,864 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java | ParameterServerClient.masterStarted | public boolean masterStarted() {
if (objectMapper == null)
objectMapper = new ObjectMapper();
try {
String type = objectMapper.readValue(
Unirest.get(String.format("http://%s:%d/opType", masterStatusHost, masterStatusPort)).asJson()
... | java | public boolean masterStarted() {
if (objectMapper == null)
objectMapper = new ObjectMapper();
try {
String type = objectMapper.readValue(
Unirest.get(String.format("http://%s:%d/opType", masterStatusHost, masterStatusPort)).asJson()
... | [
"public",
"boolean",
"masterStarted",
"(",
")",
"{",
"if",
"(",
"objectMapper",
"==",
"null",
")",
"objectMapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"try",
"{",
"String",
"type",
"=",
"objectMapper",
".",
"readValue",
"(",
"Unirest",
".",
"get",
... | Sends a post request to the
status server to determine if the master node is started.
@return | [
"Sends",
"a",
"post",
"request",
"to",
"the",
"status",
"server",
"to",
"determine",
"if",
"the",
"master",
"node",
"is",
"started",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java#L149-L169 |
128,865 | deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java | ParameterServerClient.getArray | public INDArray getArray() {
//start a subscriber that can send us ndarrays
if (subscriber == null) {
running = new AtomicBoolean(true);
subscriber = AeronNDArraySubscriber.startSubscriber(aeron, subscriberHost, subscriberPort, this,
subscriberStream, ... | java | public INDArray getArray() {
//start a subscriber that can send us ndarrays
if (subscriber == null) {
running = new AtomicBoolean(true);
subscriber = AeronNDArraySubscriber.startSubscriber(aeron, subscriberHost, subscriberPort, this,
subscriberStream, ... | [
"public",
"INDArray",
"getArray",
"(",
")",
"{",
"//start a subscriber that can send us ndarrays",
"if",
"(",
"subscriber",
"==",
"null",
")",
"{",
"running",
"=",
"new",
"AtomicBoolean",
"(",
"true",
")",
";",
"subscriber",
"=",
"AeronNDArraySubscriber",
".",
"st... | Get an ndarray from the
designated ndarray retrieve url.
This will "pull" the current ndarray
from the master
@return the current ndarray from the master. | [
"Get",
"an",
"ndarray",
"from",
"the",
"designated",
"ndarray",
"retrieve",
"url",
".",
"This",
"will",
"pull",
"the",
"current",
"ndarray",
"from",
"the",
"master"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java#L237-L293 |
128,866 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp/src/main/java/org/deeplearning4j/spark/models/embeddings/word2vec/Word2VecChange.java | Word2VecChange.apply | public void apply(InMemoryLookupTable table) {
for (Map.Entry<Integer, Set<INDArray>> entry : changes.entrySet()) {
Set<INDArray> changes = entry.getValue();
INDArray toChange = table.getSyn0().slice(entry.getKey());
for (INDArray syn1 : changes)
Nd4j.getBlasW... | java | public void apply(InMemoryLookupTable table) {
for (Map.Entry<Integer, Set<INDArray>> entry : changes.entrySet()) {
Set<INDArray> changes = entry.getValue();
INDArray toChange = table.getSyn0().slice(entry.getKey());
for (INDArray syn1 : changes)
Nd4j.getBlasW... | [
"public",
"void",
"apply",
"(",
"InMemoryLookupTable",
"table",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Set",
"<",
"INDArray",
">",
">",
"entry",
":",
"changes",
".",
"entrySet",
"(",
")",
")",
"{",
"Set",
"<",
"INDArray",
">... | Take the changes and apply them
to the given table
@param table the memory lookup table
to apply the changes to | [
"Take",
"the",
"changes",
"and",
"apply",
"them",
"to",
"the",
"given",
"table"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp/src/main/java/org/deeplearning4j/spark/models/embeddings/word2vec/Word2VecChange.java#L58-L65 |
128,867 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-data/deeplearning4j-datavec-iterators/src/main/java/org/deeplearning4j/datasets/datavec/RecordReaderDataSetIterator.java | RecordReaderDataSetIterator.loadFromMetaData | public DataSet loadFromMetaData(List<RecordMetaData> list) throws IOException {
if (underlying == null) {
Record r = recordReader.loadFromMetaData(list.get(0));
initializeUnderlying(r);
}
//Convert back to composable:
List<RecordMetaData> l = new ArrayList<>(list... | java | public DataSet loadFromMetaData(List<RecordMetaData> list) throws IOException {
if (underlying == null) {
Record r = recordReader.loadFromMetaData(list.get(0));
initializeUnderlying(r);
}
//Convert back to composable:
List<RecordMetaData> l = new ArrayList<>(list... | [
"public",
"DataSet",
"loadFromMetaData",
"(",
"List",
"<",
"RecordMetaData",
">",
"list",
")",
"throws",
"IOException",
"{",
"if",
"(",
"underlying",
"==",
"null",
")",
"{",
"Record",
"r",
"=",
"recordReader",
".",
"loadFromMetaData",
"(",
"list",
".",
"get"... | Load a multiple examples to a DataSet, using the provided RecordMetaData instances.
@param list List of RecordMetaData instances to load from. Should have been produced by the record reader provided
to the RecordReaderDataSetIterator constructor
@return DataSet with the specified examples
@throws IOException If an err... | [
"Load",
"a",
"multiple",
"examples",
"to",
"a",
"DataSet",
"using",
"the",
"provided",
"RecordMetaData",
"instances",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-data/deeplearning4j-datavec-iterators/src/main/java/org/deeplearning4j/datasets/datavec/RecordReaderDataSetIterator.java#L480-L494 |
128,868 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java | GraphLoader.loadGraph | public static <V, E> Graph<V, E> loadGraph(String path, EdgeLineProcessor<E> lineProcessor,
VertexFactory<V> vertexFactory, int numVertices, boolean allowMultipleEdges) throws IOException {
Graph<V, E> graph = new Graph<>(numVertices, allowMultipleEdges, vertexFactory);
try (Buffere... | java | public static <V, E> Graph<V, E> loadGraph(String path, EdgeLineProcessor<E> lineProcessor,
VertexFactory<V> vertexFactory, int numVertices, boolean allowMultipleEdges) throws IOException {
Graph<V, E> graph = new Graph<>(numVertices, allowMultipleEdges, vertexFactory);
try (Buffere... | [
"public",
"static",
"<",
"V",
",",
"E",
">",
"Graph",
"<",
"V",
",",
"E",
">",
"loadGraph",
"(",
"String",
"path",
",",
"EdgeLineProcessor",
"<",
"E",
">",
"lineProcessor",
",",
"VertexFactory",
"<",
"V",
">",
"vertexFactory",
",",
"int",
"numVertices",
... | Load a graph into memory, using a given EdgeLineProcessor.
Assume one edge per line
@param path Path to the file containing the edges, one per line
@param lineProcessor EdgeLineProcessor used to convert lines of text into a graph (or null for comment lines etc)
@param vertexFactory Used to create vertices
@param numVer... | [
"Load",
"a",
"graph",
"into",
"memory",
"using",
"a",
"given",
"EdgeLineProcessor",
".",
"Assume",
"one",
"edge",
"per",
"line"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java#L145-L160 |
128,869 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java | GraphLoader.loadGraph | public static <V, E> Graph<V, E> loadGraph(String vertexFilePath, String edgeFilePath, VertexLoader<V> vertexLoader,
EdgeLineProcessor<E> edgeLineProcessor, boolean allowMultipleEdges) throws IOException {
//Assume vertices are in one file
//And edges are in another file
Lis... | java | public static <V, E> Graph<V, E> loadGraph(String vertexFilePath, String edgeFilePath, VertexLoader<V> vertexLoader,
EdgeLineProcessor<E> edgeLineProcessor, boolean allowMultipleEdges) throws IOException {
//Assume vertices are in one file
//And edges are in another file
Lis... | [
"public",
"static",
"<",
"V",
",",
"E",
">",
"Graph",
"<",
"V",
",",
"E",
">",
"loadGraph",
"(",
"String",
"vertexFilePath",
",",
"String",
"edgeFilePath",
",",
"VertexLoader",
"<",
"V",
">",
"vertexLoader",
",",
"EdgeLineProcessor",
"<",
"E",
">",
"edge... | Load graph, assuming vertices are in one file and edges are in another file.
@param vertexFilePath Path to file containing vertices, one per line
@param edgeFilePath Path to the file containing edges, one per line
@param vertexLoader VertexLoader, for loading vertices from the file
@param edgeLineProcessor EdgeLinePro... | [
"Load",
"graph",
"assuming",
"vertices",
"are",
"in",
"one",
"file",
"and",
"edges",
"are",
"in",
"another",
"file",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java#L171-L190 |
128,870 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.normalizeZeroMeanAndUnitVariance | public static INDArray normalizeZeroMeanAndUnitVariance(INDArray toNormalize) {
INDArray columnMeans = toNormalize.mean(0);
INDArray columnStds = toNormalize.std(0);
toNormalize.subiRowVector(columnMeans);
//padding for non zero
columnStds.addi(Nd4j.EPS_THRESHOLD);
toNor... | java | public static INDArray normalizeZeroMeanAndUnitVariance(INDArray toNormalize) {
INDArray columnMeans = toNormalize.mean(0);
INDArray columnStds = toNormalize.std(0);
toNormalize.subiRowVector(columnMeans);
//padding for non zero
columnStds.addi(Nd4j.EPS_THRESHOLD);
toNor... | [
"public",
"static",
"INDArray",
"normalizeZeroMeanAndUnitVariance",
"(",
"INDArray",
"toNormalize",
")",
"{",
"INDArray",
"columnMeans",
"=",
"toNormalize",
".",
"mean",
"(",
"0",
")",
";",
"INDArray",
"columnStds",
"=",
"toNormalize",
".",
"std",
"(",
"0",
")",... | Normalize data to zero mean and unit variance
substract by the mean and divide by the standard deviation
@param toNormalize the ndarray to normalize
@return the normalized ndarray | [
"Normalize",
"data",
"to",
"zero",
"mean",
"and",
"unit",
"variance",
"substract",
"by",
"the",
"mean",
"and",
"divide",
"by",
"the",
"standard",
"deviation"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L159-L168 |
128,871 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.pow | public static INDArray pow(INDArray ndArray, INDArray power, boolean dup) {
INDArray result = (dup ? ndArray.ulike() : ndArray);
return exec(new PowPairwise(ndArray, power, result));
} | java | public static INDArray pow(INDArray ndArray, INDArray power, boolean dup) {
INDArray result = (dup ? ndArray.ulike() : ndArray);
return exec(new PowPairwise(ndArray, power, result));
} | [
"public",
"static",
"INDArray",
"pow",
"(",
"INDArray",
"ndArray",
",",
"INDArray",
"power",
",",
"boolean",
"dup",
")",
"{",
"INDArray",
"result",
"=",
"(",
"dup",
"?",
"ndArray",
".",
"ulike",
"(",
")",
":",
"ndArray",
")",
";",
"return",
"exec",
"("... | Element-wise power function - x^y, performed element-wise
@param ndArray the ndarray to raise to the power of
@param power the power to raise by
@param dup if true:
@return the ndarray raised to this power | [
"Element",
"-",
"wise",
"power",
"function",
"-",
"x^y",
"performed",
"element",
"-",
"wise"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L627-L630 |
128,872 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.tan | public static INDArray tan(INDArray ndArray, boolean dup) {
return exec(dup ? new Tan(ndArray, ndArray.ulike()) : new Tan(ndArray));
} | java | public static INDArray tan(INDArray ndArray, boolean dup) {
return exec(dup ? new Tan(ndArray, ndArray.ulike()) : new Tan(ndArray));
} | [
"public",
"static",
"INDArray",
"tan",
"(",
"INDArray",
"ndArray",
",",
"boolean",
"dup",
")",
"{",
"return",
"exec",
"(",
"dup",
"?",
"new",
"Tan",
"(",
"ndArray",
",",
"ndArray",
".",
"ulike",
"(",
")",
")",
":",
"new",
"Tan",
"(",
"ndArray",
")",
... | Element-wise tan function. Copies the array
@param ndArray Input array | [
"Element",
"-",
"wise",
"tan",
"function",
".",
"Copies",
"the",
"array"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L710-L712 |
128,873 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.log | public static INDArray log(INDArray ndArray, double base, boolean duplicate) {
return Nd4j.getExecutioner().exec(new LogX(ndArray, duplicate ? ndArray.ulike() : ndArray, base));
} | java | public static INDArray log(INDArray ndArray, double base, boolean duplicate) {
return Nd4j.getExecutioner().exec(new LogX(ndArray, duplicate ? ndArray.ulike() : ndArray, base));
} | [
"public",
"static",
"INDArray",
"log",
"(",
"INDArray",
"ndArray",
",",
"double",
"base",
",",
"boolean",
"duplicate",
")",
"{",
"return",
"Nd4j",
".",
"getExecutioner",
"(",
")",
".",
"exec",
"(",
"new",
"LogX",
"(",
"ndArray",
",",
"duplicate",
"?",
"n... | Log on arbitrary base
@param ndArray
@param base
@return | [
"Log",
"on",
"arbitrary",
"base"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L742-L744 |
128,874 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.sign | public static INDArray sign(INDArray toSign, boolean dup) {
return exec(dup ? new Sign(toSign, toSign.ulike()) : new Sign(toSign));
} | java | public static INDArray sign(INDArray toSign, boolean dup) {
return exec(dup ? new Sign(toSign, toSign.ulike()) : new Sign(toSign));
} | [
"public",
"static",
"INDArray",
"sign",
"(",
"INDArray",
"toSign",
",",
"boolean",
"dup",
")",
"{",
"return",
"exec",
"(",
"dup",
"?",
"new",
"Sign",
"(",
"toSign",
",",
"toSign",
".",
"ulike",
"(",
")",
")",
":",
"new",
"Sign",
"(",
"toSign",
")",
... | Signum function of this ndarray
@param toSign
@return | [
"Signum",
"function",
"of",
"this",
"ndarray"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L819-L821 |
128,875 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.max | public static INDArray max(INDArray ndArray, double k, boolean dup) {
return exec(dup ? new ScalarMax(ndArray, null, ndArray.ulike(), k) : new ScalarMax(ndArray, k));
} | java | public static INDArray max(INDArray ndArray, double k, boolean dup) {
return exec(dup ? new ScalarMax(ndArray, null, ndArray.ulike(), k) : new ScalarMax(ndArray, k));
} | [
"public",
"static",
"INDArray",
"max",
"(",
"INDArray",
"ndArray",
",",
"double",
"k",
",",
"boolean",
"dup",
")",
"{",
"return",
"exec",
"(",
"dup",
"?",
"new",
"ScalarMax",
"(",
"ndArray",
",",
"null",
",",
"ndArray",
".",
"ulike",
"(",
")",
",",
"... | Maximum function with a scalar
@param ndArray tbe ndarray
@param k
@param dup
@return | [
"Maximum",
"function",
"with",
"a",
"scalar"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L831-L833 |
128,876 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.min | public static INDArray min(INDArray ndArray, double k, boolean dup) {
return exec(dup ? new ScalarMin(ndArray, null, ndArray.ulike(), k) : new ScalarMin(ndArray, k));
} | java | public static INDArray min(INDArray ndArray, double k, boolean dup) {
return exec(dup ? new ScalarMin(ndArray, null, ndArray.ulike(), k) : new ScalarMin(ndArray, k));
} | [
"public",
"static",
"INDArray",
"min",
"(",
"INDArray",
"ndArray",
",",
"double",
"k",
",",
"boolean",
"dup",
")",
"{",
"return",
"exec",
"(",
"dup",
"?",
"new",
"ScalarMin",
"(",
"ndArray",
",",
"null",
",",
"ndArray",
".",
"ulike",
"(",
")",
",",
"... | Minimum function with a scalar
@param ndArray tbe ndarray
@param k
@param dup
@return | [
"Minimum",
"function",
"with",
"a",
"scalar"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L881-L883 |
128,877 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java | Transforms.min | public static INDArray min(INDArray first, INDArray second) {
return min(first, second, true);
} | java | public static INDArray min(INDArray first, INDArray second) {
return min(first, second, true);
} | [
"public",
"static",
"INDArray",
"min",
"(",
"INDArray",
"first",
",",
"INDArray",
"second",
")",
"{",
"return",
"min",
"(",
"first",
",",
"second",
",",
"true",
")",
";",
"}"
] | Element wise minimum function between 2 INDArrays
@param first
@param second
@return | [
"Element",
"wise",
"minimum",
"function",
"between",
"2",
"INDArrays"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L918-L920 |
128,878 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/abstracts/Nd4jWorkspace.java | Nd4jWorkspace.destroyWorkspace | @Override
public void destroyWorkspace(boolean extended) {
if (workspace.getHostPointer() != null && workspace.getHostPointer().getOriginalPointer() != null
&& workspace.getHostPointer().getOriginalPointer() instanceof BytePointer)
workspace.getHostPointer().getOriginalPo... | java | @Override
public void destroyWorkspace(boolean extended) {
if (workspace.getHostPointer() != null && workspace.getHostPointer().getOriginalPointer() != null
&& workspace.getHostPointer().getOriginalPointer() instanceof BytePointer)
workspace.getHostPointer().getOriginalPo... | [
"@",
"Override",
"public",
"void",
"destroyWorkspace",
"(",
"boolean",
"extended",
")",
"{",
"if",
"(",
"workspace",
".",
"getHostPointer",
"(",
")",
"!=",
"null",
"&&",
"workspace",
".",
"getHostPointer",
"(",
")",
".",
"getOriginalPointer",
"(",
")",
"!=",... | This method basically deallocates workspace memory
@param extended | [
"This",
"method",
"basically",
"deallocates",
"workspace",
"memory"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/abstracts/Nd4jWorkspace.java#L543-L559 |
128,879 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/abstracts/Nd4jWorkspace.java | Nd4jWorkspace.notifyScopeBorrowed | @Override
public MemoryWorkspace notifyScopeBorrowed() {
if (isBorrowed.get())
throw new ND4JIllegalStateException("Workspace [" + id + "]: Can't borrow from borrowed workspace");
borrowingWorkspace = Nd4j.getMemoryManager().getCurrentWorkspace();
isBorrowed.set(true);
... | java | @Override
public MemoryWorkspace notifyScopeBorrowed() {
if (isBorrowed.get())
throw new ND4JIllegalStateException("Workspace [" + id + "]: Can't borrow from borrowed workspace");
borrowingWorkspace = Nd4j.getMemoryManager().getCurrentWorkspace();
isBorrowed.set(true);
... | [
"@",
"Override",
"public",
"MemoryWorkspace",
"notifyScopeBorrowed",
"(",
")",
"{",
"if",
"(",
"isBorrowed",
".",
"get",
"(",
")",
")",
"throw",
"new",
"ND4JIllegalStateException",
"(",
"\"Workspace [\"",
"+",
"id",
"+",
"\"]: Can't borrow from borrowed workspace\"",
... | This method TEMPORARY enters this workspace, without reset applied
@return | [
"This",
"method",
"TEMPORARY",
"enters",
"this",
"workspace",
"without",
"reset",
"applied"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/abstracts/Nd4jWorkspace.java#L566-L577 |
128,880 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.modelJsonFilename | public KerasModelBuilder modelJsonFilename(String modelJsonFilename) throws IOException {
checkForExistence(modelJsonFilename);
this.modelJson = new String(Files.readAllBytes(Paths.get(modelJsonFilename)));
return this;
} | java | public KerasModelBuilder modelJsonFilename(String modelJsonFilename) throws IOException {
checkForExistence(modelJsonFilename);
this.modelJson = new String(Files.readAllBytes(Paths.get(modelJsonFilename)));
return this;
} | [
"public",
"KerasModelBuilder",
"modelJsonFilename",
"(",
"String",
"modelJsonFilename",
")",
"throws",
"IOException",
"{",
"checkForExistence",
"(",
"modelJsonFilename",
")",
";",
"this",
".",
"modelJson",
"=",
"new",
"String",
"(",
"Files",
".",
"readAllBytes",
"("... | Set model architecture from file name pointing to model JSON string.
@param modelJsonFilename Name of file containing model JSON string
@return Model Builder
@throws IOException I/O Exception | [
"Set",
"model",
"architecture",
"from",
"file",
"name",
"pointing",
"to",
"model",
"JSON",
"string",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L88-L92 |
128,881 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.modelYamlFilename | public KerasModelBuilder modelYamlFilename(String modelYamlFilename) throws IOException {
checkForExistence(modelYamlFilename);
this.modelJson = new String(Files.readAllBytes(Paths.get(modelYamlFilename)));
return this;
} | java | public KerasModelBuilder modelYamlFilename(String modelYamlFilename) throws IOException {
checkForExistence(modelYamlFilename);
this.modelJson = new String(Files.readAllBytes(Paths.get(modelYamlFilename)));
return this;
} | [
"public",
"KerasModelBuilder",
"modelYamlFilename",
"(",
"String",
"modelYamlFilename",
")",
"throws",
"IOException",
"{",
"checkForExistence",
"(",
"modelYamlFilename",
")",
";",
"this",
".",
"modelJson",
"=",
"new",
"String",
"(",
"Files",
".",
"readAllBytes",
"("... | Set model architecture from file name pointing to model YAML string.
@param modelYamlFilename Name of file containing model YAML string
@return Model Builder
@throws IOException I/O Exception | [
"Set",
"model",
"architecture",
"from",
"file",
"name",
"pointing",
"to",
"model",
"YAML",
"string",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L101-L105 |
128,882 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.modelJsonInputStream | public KerasModelBuilder modelJsonInputStream(InputStream modelJsonInputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(modelJsonInputStream, byteArrayOutputStream);
this.modelJson = new String(byteArrayOutputStream.toByteArray... | java | public KerasModelBuilder modelJsonInputStream(InputStream modelJsonInputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(modelJsonInputStream, byteArrayOutputStream);
this.modelJson = new String(byteArrayOutputStream.toByteArray... | [
"public",
"KerasModelBuilder",
"modelJsonInputStream",
"(",
"InputStream",
"modelJsonInputStream",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"byteArrayOutputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"IOUtils",
".",
"copy",
"(",
"modelJ... | Set model architecture from input stream of model JSON.
@param modelJsonInputStream Input stream of model JSON
@return Model builder
@throws IOException I/O exception | [
"Set",
"model",
"architecture",
"from",
"input",
"stream",
"of",
"model",
"JSON",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L114-L119 |
128,883 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.modelYamlInputStream | public KerasModelBuilder modelYamlInputStream(InputStream modelYamlInputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(modelYamlInputStream, byteArrayOutputStream);
this.modelJson = new String(byteArrayOutputStream.toByteArray... | java | public KerasModelBuilder modelYamlInputStream(InputStream modelYamlInputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(modelYamlInputStream, byteArrayOutputStream);
this.modelJson = new String(byteArrayOutputStream.toByteArray... | [
"public",
"KerasModelBuilder",
"modelYamlInputStream",
"(",
"InputStream",
"modelYamlInputStream",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"byteArrayOutputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"IOUtils",
".",
"copy",
"(",
"modelY... | Set model architecture from input stream of model YAML.
@param modelYamlInputStream Input stream of model YAML
@return Model builder
@throws IOException I/O exception | [
"Set",
"model",
"architecture",
"from",
"input",
"stream",
"of",
"model",
"YAML",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L128-L133 |
128,884 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.trainingJsonInputStream | public KerasModelBuilder trainingJsonInputStream(InputStream trainingJsonInputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(trainingJsonInputStream, byteArrayOutputStream);
this.trainingJson = new String(byteArrayOutputStream... | java | public KerasModelBuilder trainingJsonInputStream(InputStream trainingJsonInputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(trainingJsonInputStream, byteArrayOutputStream);
this.trainingJson = new String(byteArrayOutputStream... | [
"public",
"KerasModelBuilder",
"trainingJsonInputStream",
"(",
"InputStream",
"trainingJsonInputStream",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"byteArrayOutputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"IOUtils",
".",
"copy",
"(",
"... | Provide training configuration as file input stream from JSON
@param trainingJsonInputStream Input stream of training JSON string
@return Model builder | [
"Provide",
"training",
"configuration",
"as",
"file",
"input",
"stream",
"from",
"JSON"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L193-L198 |
128,885 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.trainingYamlInputStream | public KerasModelBuilder trainingYamlInputStream(InputStream trainingYamlInputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(trainingYamlInputStream, byteArrayOutputStream);
this.trainingYaml = new String(byteArrayOutputStream... | java | public KerasModelBuilder trainingYamlInputStream(InputStream trainingYamlInputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(trainingYamlInputStream, byteArrayOutputStream);
this.trainingYaml = new String(byteArrayOutputStream... | [
"public",
"KerasModelBuilder",
"trainingYamlInputStream",
"(",
"InputStream",
"trainingYamlInputStream",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"byteArrayOutputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"IOUtils",
".",
"copy",
"(",
"... | Provide training configuration as file input stream from YAML
@param trainingYamlInputStream Input stream of training YAML string
@return Model builder | [
"Provide",
"training",
"configuration",
"as",
"file",
"input",
"stream",
"from",
"YAML"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L206-L211 |
128,886 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.weightsHdf5FilenameNoRoot | public KerasModelBuilder weightsHdf5FilenameNoRoot(String weightsHdf5Filename) throws IOException {
checkForExistence(weightsHdf5Filename);
this.weightsArchive = new Hdf5Archive(weightsHdf5Filename);
return this;
} | java | public KerasModelBuilder weightsHdf5FilenameNoRoot(String weightsHdf5Filename) throws IOException {
checkForExistence(weightsHdf5Filename);
this.weightsArchive = new Hdf5Archive(weightsHdf5Filename);
return this;
} | [
"public",
"KerasModelBuilder",
"weightsHdf5FilenameNoRoot",
"(",
"String",
"weightsHdf5Filename",
")",
"throws",
"IOException",
"{",
"checkForExistence",
"(",
"weightsHdf5Filename",
")",
";",
"this",
".",
"weightsArchive",
"=",
"new",
"Hdf5Archive",
"(",
"weightsHdf5Filen... | Set weights of the model by providing the file name of the corresponding weights HDF5 file.
The root of the HDF5 group containing weights won't be set by this method.
@param weightsHdf5Filename File name of weights HDF5
@return Model builder | [
"Set",
"weights",
"of",
"the",
"model",
"by",
"providing",
"the",
"file",
"name",
"of",
"the",
"corresponding",
"weights",
"HDF5",
"file",
".",
"The",
"root",
"of",
"the",
"HDF5",
"group",
"containing",
"weights",
"won",
"t",
"be",
"set",
"by",
"this",
"... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L265-L269 |
128,887 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.weightsHdf5Filename | public KerasModelBuilder weightsHdf5Filename(String weightsHdf5Filename) throws IOException {
checkForExistence(weightsHdf5Filename);
this.weightsArchive = new Hdf5Archive(weightsHdf5Filename);
this.weightsRoot = config.getTrainingWeightsRoot();
return this;
} | java | public KerasModelBuilder weightsHdf5Filename(String weightsHdf5Filename) throws IOException {
checkForExistence(weightsHdf5Filename);
this.weightsArchive = new Hdf5Archive(weightsHdf5Filename);
this.weightsRoot = config.getTrainingWeightsRoot();
return this;
} | [
"public",
"KerasModelBuilder",
"weightsHdf5Filename",
"(",
"String",
"weightsHdf5Filename",
")",
"throws",
"IOException",
"{",
"checkForExistence",
"(",
"weightsHdf5Filename",
")",
";",
"this",
".",
"weightsArchive",
"=",
"new",
"Hdf5Archive",
"(",
"weightsHdf5Filename",
... | Set weights of the model by providing the file name of the corresponding weights HDF5 file.
The root of the HDF5 group containing weights will be read and set from the configuration of this
model builder instance.
@param weightsHdf5Filename File name of weights HDF5
@return Model builder | [
"Set",
"weights",
"of",
"the",
"model",
"by",
"providing",
"the",
"file",
"name",
"of",
"the",
"corresponding",
"weights",
"HDF5",
"file",
".",
"The",
"root",
"of",
"the",
"HDF5",
"group",
"containing",
"weights",
"will",
"be",
"read",
"and",
"set",
"from"... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L279-L284 |
128,888 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java | KerasModelBuilder.close | @Override
public void close() {
if (trainingArchive != null && trainingArchive != weightsArchive) {
trainingArchive.close();
trainingArchive = null;
}
if (weightsArchive != null) {
weightsArchive.close();
weightsArchive = null;
}
} | java | @Override
public void close() {
if (trainingArchive != null && trainingArchive != weightsArchive) {
trainingArchive.close();
trainingArchive = null;
}
if (weightsArchive != null) {
weightsArchive.close();
weightsArchive = null;
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"trainingArchive",
"!=",
"null",
"&&",
"trainingArchive",
"!=",
"weightsArchive",
")",
"{",
"trainingArchive",
".",
"close",
"(",
")",
";",
"trainingArchive",
"=",
"null",
";",
"}",
"if"... | Close all HDF5 archives for this model builder. | [
"Close",
"all",
"HDF5",
"archives",
"for",
"this",
"model",
"builder",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelBuilder.java#L330-L340 |
128,889 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.ddoti | @Override
protected double ddoti(long N, INDArray X, DataBuffer indx, INDArray Y) {
return cblas_ddoti((int) N, (DoublePointer) X.data().addressPointer(),(IntPointer) indx.addressPointer(),
(DoublePointer) Y.data().addressPointer());
} | java | @Override
protected double ddoti(long N, INDArray X, DataBuffer indx, INDArray Y) {
return cblas_ddoti((int) N, (DoublePointer) X.data().addressPointer(),(IntPointer) indx.addressPointer(),
(DoublePointer) Y.data().addressPointer());
} | [
"@",
"Override",
"protected",
"double",
"ddoti",
"(",
"long",
"N",
",",
"INDArray",
"X",
",",
"DataBuffer",
"indx",
",",
"INDArray",
"Y",
")",
"{",
"return",
"cblas_ddoti",
"(",
"(",
"int",
")",
"N",
",",
"(",
"DoublePointer",
")",
"X",
".",
"data",
... | Computes the dot product of a compressed sparse double vector by a full-storage real vector.
@param N The number of elements in x and indx
@param X an sparse INDArray. Size at least N
@param indx an Databuffer that Specifies the indices for the elements of x. Size at least N
@param Y a dense INDArray. Size at least max... | [
"Computes",
"the",
"dot",
"product",
"of",
"a",
"compressed",
"sparse",
"double",
"vector",
"by",
"a",
"full",
"-",
"storage",
"real",
"vector",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L44-L48 |
128,890 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.sdoti | @Override
protected double sdoti(long N, INDArray X, DataBuffer indx, INDArray Y) {
return cblas_sdoti((int) N, (FloatPointer) X.data().addressPointer(),(IntPointer) indx.addressPointer(),
(FloatPointer) Y.data().addressPointer());
} | java | @Override
protected double sdoti(long N, INDArray X, DataBuffer indx, INDArray Y) {
return cblas_sdoti((int) N, (FloatPointer) X.data().addressPointer(),(IntPointer) indx.addressPointer(),
(FloatPointer) Y.data().addressPointer());
} | [
"@",
"Override",
"protected",
"double",
"sdoti",
"(",
"long",
"N",
",",
"INDArray",
"X",
",",
"DataBuffer",
"indx",
",",
"INDArray",
"Y",
")",
"{",
"return",
"cblas_sdoti",
"(",
"(",
"int",
")",
"N",
",",
"(",
"FloatPointer",
")",
"X",
".",
"data",
"... | Computes the dot product of a compressed sparse float vector by a full-storage real vector.
@param N The number of elements in x and indx
@param X an sparse INDArray. Size at least N
@param indx an Databuffer that specifies the indices for the elements of x. Size at least N
@param Y a dense INDArray. Size at least max(... | [
"Computes",
"the",
"dot",
"product",
"of",
"a",
"compressed",
"sparse",
"float",
"vector",
"by",
"a",
"full",
"-",
"storage",
"real",
"vector",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L57-L61 |
128,891 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.dnrm2 | @Override
protected double dnrm2(long N, INDArray X, int incx){
return cblas_dnrm2((int) N, (DoublePointer) X.data().addressPointer(), incx);
} | java | @Override
protected double dnrm2(long N, INDArray X, int incx){
return cblas_dnrm2((int) N, (DoublePointer) X.data().addressPointer(), incx);
} | [
"@",
"Override",
"protected",
"double",
"dnrm2",
"(",
"long",
"N",
",",
"INDArray",
"X",
",",
"int",
"incx",
")",
"{",
"return",
"cblas_dnrm2",
"(",
"(",
"int",
")",
"N",
",",
"(",
"DoublePointer",
")",
"X",
".",
"data",
"(",
")",
".",
"addressPointe... | Computes the Euclidean norm of a double vector
@param N The number of elements in vector X
@param X an INDArray
@param incx the increment of X | [
"Computes",
"the",
"Euclidean",
"norm",
"of",
"a",
"double",
"vector"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L85-L88 |
128,892 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.daxpyi | @Override
protected void daxpyi(long N, double alpha, INDArray X, DataBuffer pointers, INDArray Y){
cblas_daxpyi((int) N, alpha, (DoublePointer) X.data().addressPointer(), (IntPointer) pointers.addressPointer(),
(DoublePointer) Y.data().addressPointer());
} | java | @Override
protected void daxpyi(long N, double alpha, INDArray X, DataBuffer pointers, INDArray Y){
cblas_daxpyi((int) N, alpha, (DoublePointer) X.data().addressPointer(), (IntPointer) pointers.addressPointer(),
(DoublePointer) Y.data().addressPointer());
} | [
"@",
"Override",
"protected",
"void",
"daxpyi",
"(",
"long",
"N",
",",
"double",
"alpha",
",",
"INDArray",
"X",
",",
"DataBuffer",
"pointers",
",",
"INDArray",
"Y",
")",
"{",
"cblas_daxpyi",
"(",
"(",
"int",
")",
"N",
",",
"alpha",
",",
"(",
"DoublePoi... | Adds a scalar multiple of double compressed sparse vector to a full-storage vector.
@param N The number of elements in vector X
@param alpha
@param X a sparse vector
@param pointers A DataBuffer that specifies the indices for the elements of x.
@param Y a dense vector | [
"Adds",
"a",
"scalar",
"multiple",
"of",
"double",
"compressed",
"sparse",
"vector",
"to",
"a",
"full",
"-",
"storage",
"vector",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L195-L199 |
128,893 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.saxpyi | @Override
protected void saxpyi(long N, double alpha, INDArray X, DataBuffer pointers, INDArray Y) {
cblas_saxpyi((int) N, (float) alpha, (FloatPointer) X.data().addressPointer(), (IntPointer) pointers.addressPointer(),
(FloatPointer) Y.data().addressPointer());
} | java | @Override
protected void saxpyi(long N, double alpha, INDArray X, DataBuffer pointers, INDArray Y) {
cblas_saxpyi((int) N, (float) alpha, (FloatPointer) X.data().addressPointer(), (IntPointer) pointers.addressPointer(),
(FloatPointer) Y.data().addressPointer());
} | [
"@",
"Override",
"protected",
"void",
"saxpyi",
"(",
"long",
"N",
",",
"double",
"alpha",
",",
"INDArray",
"X",
",",
"DataBuffer",
"pointers",
",",
"INDArray",
"Y",
")",
"{",
"cblas_saxpyi",
"(",
"(",
"int",
")",
"N",
",",
"(",
"float",
")",
"alpha",
... | Adds a scalar multiple of float compressed sparse vector to a full-storage vector.
@param N The number of elements in vector X
@param alpha
@param X a sparse vector
@param pointers A DataBuffer that specifies the indices for the elements of x.
@param Y a dense vector | [
"Adds",
"a",
"scalar",
"multiple",
"of",
"float",
"compressed",
"sparse",
"vector",
"to",
"a",
"full",
"-",
"storage",
"vector",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L211-L215 |
128,894 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.dscal | @Override
protected void dscal(long N, double a, INDArray X, int incx) {
cblas_dscal((int) N, a, (DoublePointer) X.data().addressPointer(), incx);
} | java | @Override
protected void dscal(long N, double a, INDArray X, int incx) {
cblas_dscal((int) N, a, (DoublePointer) X.data().addressPointer(), incx);
} | [
"@",
"Override",
"protected",
"void",
"dscal",
"(",
"long",
"N",
",",
"double",
"a",
",",
"INDArray",
"X",
",",
"int",
"incx",
")",
"{",
"cblas_dscal",
"(",
"(",
"int",
")",
"N",
",",
"a",
",",
"(",
"DoublePointer",
")",
"X",
".",
"data",
"(",
")... | Computes the product of a double vector by a scalar.
@param N The number of elements of the vector X
@param a a scalar
@param X a vector
@param incx the increment of the vector X | [
"Computes",
"the",
"product",
"of",
"a",
"double",
"vector",
"by",
"a",
"scalar",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L267-L270 |
128,895 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.sscal | @Override
protected void sscal(long N, double a, INDArray X, int incx) {
cblas_sscal((int) N, (float) a, (FloatPointer) X.data().addressPointer(), incx);
} | java | @Override
protected void sscal(long N, double a, INDArray X, int incx) {
cblas_sscal((int) N, (float) a, (FloatPointer) X.data().addressPointer(), incx);
} | [
"@",
"Override",
"protected",
"void",
"sscal",
"(",
"long",
"N",
",",
"double",
"a",
",",
"INDArray",
"X",
",",
"int",
"incx",
")",
"{",
"cblas_sscal",
"(",
"(",
"int",
")",
"N",
",",
"(",
"float",
")",
"a",
",",
"(",
"FloatPointer",
")",
"X",
".... | Computes the product of a float vector by a scalar.
@param N The number of elements of the vector X
@param a a scalar
@param X a vector
@param incx the increment of the vector X | [
"Computes",
"the",
"product",
"of",
"a",
"float",
"vector",
"by",
"a",
"scalar",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L280-L283 |
128,896 | deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/impl/CudaFullCachingProvider.java | CudaFullCachingProvider.ensureDeviceCacheHolder | protected void ensureDeviceCacheHolder(Integer deviceId, AllocationShape shape) {
if (!deviceCache.containsKey(deviceId)) {
try {
synchronized (this) {
if (!deviceCache.containsKey(deviceId)) {
deviceCache.put(deviceId, new ConcurrentHashMap... | java | protected void ensureDeviceCacheHolder(Integer deviceId, AllocationShape shape) {
if (!deviceCache.containsKey(deviceId)) {
try {
synchronized (this) {
if (!deviceCache.containsKey(deviceId)) {
deviceCache.put(deviceId, new ConcurrentHashMap... | [
"protected",
"void",
"ensureDeviceCacheHolder",
"(",
"Integer",
"deviceId",
",",
"AllocationShape",
"shape",
")",
"{",
"if",
"(",
"!",
"deviceCache",
".",
"containsKey",
"(",
"deviceId",
")",
")",
"{",
"try",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",... | This method checks, if storage contains holder for specified shape
@param deviceId
@param shape | [
"This",
"method",
"checks",
"if",
"storage",
"contains",
"holder",
"for",
"specified",
"shape"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/impl/CudaFullCachingProvider.java#L172-L198 |
128,897 | deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/weights/WeightInitUtil.java | WeightInitUtil.reshapeWeights | public static INDArray reshapeWeights(long[] shape, INDArray paramsView, char flatteningOrder) {
return paramsView.reshape(flatteningOrder, shape);
} | java | public static INDArray reshapeWeights(long[] shape, INDArray paramsView, char flatteningOrder) {
return paramsView.reshape(flatteningOrder, shape);
} | [
"public",
"static",
"INDArray",
"reshapeWeights",
"(",
"long",
"[",
"]",
"shape",
",",
"INDArray",
"paramsView",
",",
"char",
"flatteningOrder",
")",
"{",
"return",
"paramsView",
".",
"reshape",
"(",
"flatteningOrder",
",",
"shape",
")",
";",
"}"
] | Reshape the parameters view, without modifying the paramsView array values.
@param shape Shape to reshape
@param paramsView Parameters array view
@param flatteningOrder Order in which parameters are flattened/reshaped | [
"Reshape",
"the",
"parameters",
"view",
"without",
"modifying",
"the",
"paramsView",
"array",
"values",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/weights/WeightInitUtil.java#L220-L222 |
128,898 | deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/transform/parse/ParseDoubleTransform.java | ParseDoubleTransform.transform | @Override
public Schema transform(Schema inputSchema) {
Schema.Builder newSchema = new Schema.Builder();
for (int i = 0; i < inputSchema.numColumns(); i++) {
if (inputSchema.getType(i) == ColumnType.String) {
newSchema.addColumnDouble(inputSchema.getMetaData(i).getName())... | java | @Override
public Schema transform(Schema inputSchema) {
Schema.Builder newSchema = new Schema.Builder();
for (int i = 0; i < inputSchema.numColumns(); i++) {
if (inputSchema.getType(i) == ColumnType.String) {
newSchema.addColumnDouble(inputSchema.getMetaData(i).getName())... | [
"@",
"Override",
"public",
"Schema",
"transform",
"(",
"Schema",
"inputSchema",
")",
"{",
"Schema",
".",
"Builder",
"newSchema",
"=",
"new",
"Schema",
".",
"Builder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"inputSchema",
".",
... | Get the output schema for this transformation, given an input schema
@param inputSchema | [
"Get",
"the",
"output",
"schema",
"for",
"this",
"transformation",
"given",
"an",
"input",
"schema"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/transform/parse/ParseDoubleTransform.java#L48-L59 |
128,899 | JakeWharton/butterknife | butterknife-compiler/src/main/java/butterknife/compiler/ButterKnifeProcessor.java | ButterKnifeProcessor.findDuplicate | private static @Nullable Integer findDuplicate(int[] array) {
Set<Integer> seenElements = new LinkedHashSet<>();
for (int element : array) {
if (!seenElements.add(element)) {
return element;
}
}
return null;
} | java | private static @Nullable Integer findDuplicate(int[] array) {
Set<Integer> seenElements = new LinkedHashSet<>();
for (int element : array) {
if (!seenElements.add(element)) {
return element;
}
}
return null;
} | [
"private",
"static",
"@",
"Nullable",
"Integer",
"findDuplicate",
"(",
"int",
"[",
"]",
"array",
")",
"{",
"Set",
"<",
"Integer",
">",
"seenElements",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"element",
":",
"array",
")",
"{... | Returns the first duplicate element inside an array, null if there are no duplicates. | [
"Returns",
"the",
"first",
"duplicate",
"element",
"inside",
"an",
"array",
"null",
"if",
"there",
"are",
"no",
"duplicates",
"."
] | 0ead8a7b21620effcf78c728089fc16ae9d664c0 | https://github.com/JakeWharton/butterknife/blob/0ead8a7b21620effcf78c728089fc16ae9d664c0/butterknife-compiler/src/main/java/butterknife/compiler/ButterKnifeProcessor.java#L974-L984 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.