Skip to content

Instantly share code, notes, and snippets.

View namhkoh's full-sized avatar
💻
Processing...

namhkoh

💻
Processing...
View GitHub Profile
@granoeste
granoeste / EachDirectoryPath.md
Last active July 23, 2024 09:11
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

from __future__ import print_function
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
def reduce_to_k_dim(M, k=2):
""" Reduce a co-occurence count matrix of dimensionality (num_corpus_words, num_corpus_words)
to a matrix of dimensionality (num_corpus_words, k) using the following SVD function from Scikit-Learn:
- http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.TruncatedSVD.html
Params:
M (numpy matrix of shape (number of corpus words, number of corpus words)): co-occurence matrix of word counts
k (int): embedding size of each word after dimension reduction
Return:
M_reduced (numpy matrix of shape (number of corpus words, k)): matrix of k-dimensioal word embeddings.
public class NetworkManager : MonoBehaviour {
private void Start() {
StartCoroutine(MakeRequests());
}
private IEnumerator MakeRequests() {
// GET
var getRequest = CreateRequest("https://jsonplaceholder.typicode.com/todos/1");
yield return getRequest.SendWebRequest();