- The first mention I found to ReLU is in Fukushima's paper from 1975: Cognitron: A self-organizing multilayered neural network | SpringerLink
- Nair and Hinton paper from 2010 make the case that ReLU preserves information during backpropagation Rectified Linear Units Improve Restricted Boltzmann Machines
- Why is the ReLU function not differentiable at x=0?
- Deep Learning with Python - François Chollet
-
Install Homebrew The Missing Package Manager for macOS (or Linux) — Homebrew
-
Download Miniforge3
-
Install Miniforge3 and restart your terminal as soon as the installation finishes:
This file contains 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
import numpy as np | |
import pandas as pd | |
import random | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import Flatten, Conv2D, Dense, MaxPooling2D | |
from tensorflow.keras.optimizers import SGD | |
from tensorflow.keras.utils import to_categorical |
This file contains 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
import cv2 | |
import numpy as np | |
from matplotlib import pyplot as plt | |
image = cv2.imread("building.jpg") | |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) | |
horizontal_edges = cv2.filter2D(image, -1, np.array([ | |
[-1, -2, -1], | |
[ 0, 0, 0], |
This file contains 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
import numpy as np | |
def sigmoid(x): | |
return 1 / (1 + np.exp(-x)) | |
def neural_network(X, y): | |
learning_rate = 0.1 | |
W1 = np.random.rand(2, 4) | |
W2 = np.random.rand(4, 1) |
This file contains 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
#!/bin/bash | |
set -e | |
sudo -u ec2-user -i <<'EOF' | |
ENVIRONMENT=python38 | |
VERSION=3.8 | |
conda create -y -n "$ENVIRONMENT" python="$VERSION" tensorflow-gpu numpy opencv pandas pyyaml |
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.
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 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
# Using Python's enumerate built-in function | |
# Let's assume we want to print every day from the following | |
# list together with its position in the list (starting at 1.) | |
days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] | |
""" Solution 1. Works, but Python has a better way """ | |
# We can use a control variable that we increment for every | |
# value in the list. |