Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| def softmax(x): | |
| """Calculates the softmax for each row of the input x. | |
| Your code should work for a row vector and also for matrices of shape (n, m). | |
| Argument: | |
| x -- A numpy matrix of shape (n,m) | |
| Returns: | |
| s -- A numpy matrix equal to the softmax of x, of shape (n,m) |
| def image2vector(image): | |
| """ | |
| Argument: | |
| image -- a numpy array of shape (length, height, depth) | |
| Returns: | |
| v -- a vector of shape (length*height*depth, 1) | |
| """ | |
| v = image.reshape((image.shape[0] * image.shape[1] * image.shape[2], 1)) |
| def sigmoid(x): | |
| """ | |
| Compute the sigmoid of x | |
| Arguments: | |
| x -- A scalar or numpy array of any size | |
| Return: | |
| s -- sigmoid(x) | |
| """ |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| title | output |
|---|---|
R Notebook |
html_notebook |
| title | output |
|---|---|
R Notebook |
html_notebook |
library(data.table)
fread("A,B
1,2| title | output |
|---|---|
R Notebook |
html_notebook |
write.table(read.table(text = "
CHR_A BP_A SNP_A CHR_B BP_B SNP_B R2
1 154834183 rs1218582 1 154794318 rs9970364 0.0929391 | # One chunk - Linear Regression in R | |
| Source: https://medium.com/dsnet/linear-regression-with-pytorch-3dde91d60b50 | |
| ```{r} | |
| # Force using local Python environment | |
| if (.Platform$OS.type == "unix") { | |
| reticulate::use_python(python = file.path(script_path, "..", "conda", "bin", | |
| "python3"), require = TRUE) | |
| } else if (.Platform$OS.type == "windows") { |
| # find_rsuite_root <- function(key = "PARAMETERS") rprojroot::find_root(key) | |
| ace_rsuite <- find_rsuite_root() | |
| lib_path <- file.path(ace_rsuite, "libs") | |
| sbox_path <- file.path(ace_rsuite, "sbox") | |
| if (!file.exists(lib_path)) { | |
| lib_path <- file.path(find_rsuite_root(), "deployment", "libs") | |
| sbox_path <- file.path(find_rsuite_root(), "deployment", "sbox") | |
| } |
| find_rsuite_root <- function(key = "PARAMETERS") rprojroot::find_root(key) | |
| source(file.path(find_rsuite_root(), 'R', 'set_env.R'), chdir = TRUE) | |
| options(rsuite.cache_path = "~/.rsuite/cache") | |
| options(rsuite.user_templ_path = "~/.rsuite/templates") |