This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def sigmoid_derivative(x): | |
| """ | |
| Compute the gradient (also called the slope or derivative) of the sigmoid function with respect to its input x. | |
| You can store the output of the sigmoid function into variables and then use it to calculate the gradient. | |
| Arguments: | |
| x -- A scalar or numpy array | |
| Return: | |
| ds -- Your computed gradient. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def normalizeRows(x): | |
| """ | |
| Implement a function that normalizes each row of the matrix x (to have unit length). | |
| Argument: | |
| x -- A numpy matrix of shape (n, m) | |
| Returns: | |
| x -- The normalized (by row) numpy matrix. You are allowed to modify x. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
NewerOlder