Skip to content

Instantly share code, notes, and snippets.

View f0nzie's full-sized avatar

Alfonso R. Reyes f0nzie

  • Oil Gains Analytics
  • Houston, Texas
View GitHub Profile
#!/home/msfz751/.pyenv/shims/python3
# #!/usr/bin/env python
# change to location of your preferred virtual environment
# Source:
# https://itectec.com/ubuntu/ubuntu-taking-screenshot-of-a-specific-area-from-the-command-line/
import subprocess
import os
import sys
@f0nzie
f0nzie / rmarch.ipynb
Created December 12, 2019 17:42
rmarch.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@f0nzie
f0nzie / backward-pytorch.ipynb
Created December 11, 2019 22:39
backward pytorch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@f0nzie
f0nzie / mnist_digits_rstats.Rmd
Last active July 16, 2019 01:08
code in R for mnist_digits_rstats.Rmd
# Digits recognition on PNG images. R code
1. Added utility functions
2. Introspection on dim=2. Extra layers on tensor
3. Converting code from Python to R
## Objectives
1. Read PNG images instead of MNIST standard dataset.
2. Save the model
3. Read an unseen digit as PNG file using the saved model
@f0nzie
f0nzie / mnist_digits_python.Rmd
Last active July 16, 2019 00:50
code for mnist_digits_python.Rmd
# Digits recognition on PNG images. Python code
Source: https://www.deeplearningwizard.com/deep_learning/practical_pytorch/pytorch_logistic_regression/
> This is a modified version of the original article.
1. added utility functions
2. Introspection on dim=2
3. Converting code to R
4. Read PNG images instead of MNIST standard dataset
@f0nzie
f0nzie / .Rprofile
Created July 15, 2019 23:12
.Rprofile for master project
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")
@f0nzie
f0nzie / .Rprofile
Last active July 16, 2019 01:10
.Rprofile for notebooks under ./work/notebooks
find_rsuite_root <- function(key = "PARAMETERS") rprojroot::find_root(key)
source(file.path(find_rsuite_root(), 'R', 'set_env.R'), chdir = TRUE)
.libPaths(c(normalizePath(sbox_path), normalizePath(lib_path), .libPaths()))
@f0nzie
f0nzie / set_env.R
Created July 15, 2019 22:20
set_env script with rprojroot
# 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")
}
@f0nzie
f0nzie / PyTorch_linear_regression.Rmd
Created June 11, 2019 04:41
PyTorch - Linear Regression in Python
# One chunk - Linear Regression in Python
Source: https://medium.com/dsnet/linear-regression-with-pytorch-3dde91d60b50
Notebook: https://jvn.io/aakashns/e556978bda9343f3b30b3a9fd2a25012
```{r}
library(reticulate)
use_condaenv("pytorch37")
py_config()
@f0nzie
f0nzie / rTorch_linear_regression.Rmd
Created June 11, 2019 04:39
PyTorch - Linear Regression in R - rsuite version
# 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") {