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
| import tensorflow as tf | |
| from IPython.display import Markdown, display | |
| import numpy as np | |
| mnist = tf.keras.datasets.mnist | |
| (x_train, y_train), (x_test, y_test) = mnist.load_data() | |
| x_train, x_test = x_train / 255.0, x_test / 255.0 | |
| y_train = tf.one_hot(y_train, 10) |
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
| import tensorflow as tf | |
| from tensorflow.keras.layers import Flatten | |
| from IPython.display import Markdown, display | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| mnist = tf.keras.datasets.mnist | |
| (x_train, y_train), (x_test, y_test) = mnist.load_data() | |
| x_train, x_test = x_train / 255.0, x_test / 255.0 |
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
| import matplotlib.pyplot as plt | |
| import cv2 | |
| import numpy as np | |
| !wget https://dl.dropbox.com/s/i1e1brycec3hy3k/pilot-view.jpeg -O pilot-view.png | |
| # For this evalution, we assume that we load image with 3 channels. | |
| def toRGB(img): |
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
| import matplotlib.pyplot as plt | |
| import cv2 | |
| import numpy as np | |
| !wget https://dl.dropbox.com/s/i1e1brycec3hy3k/pilot-view.jpeg -O pilot-view.png | |
| # For this evalution, we assume that we load image with 3 channels. | |
| def toRGB(img): |
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
| disp("Dropout, overcome the overfitting in NN...."); | |
| function [X] = dropout(X, keep_prob) | |
| % Dropout some units from X. | |
| % (1 - keep_prob) of units will be dropped out. | |
| sz = size(X); | |
| mask = rand(sz); | |
| mask = mask < 0.8; % Element of mask will be set to 1 or 0 with probability ๐๐๐๐_๐๐๐๐ |
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
| # An approach to do F_Score without np, however, using np is quite effective. | |
| def F_Score(pred_list, true_list): | |
| def bitwise(a, b, core): | |
| return [int(core(pred, true)) for pred, true in zip(pred_list, true_list)] | |
| true_positive = bitwise(pred_list, true_list, lambda pred, true: pred==1 and true==1) | |
| true_positive = sum(true_positive) | |
| false_positive = bitwise(pred_list, true_list, lambda pred, true: pred==1 and true==0) | |
| false_positive = sum(false_positive) |
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
| "terminal.integrated.env.windows": { | |
| "PATH": "/usr/local/lib/octave/6.4.0/bin" | |
| }, | |
| "octave-formatter.pythonPath": "/usr/bin/python3", |
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
| { | |
| "octave-formatter.pythonPath": "/usr/bin/python3" | |
| } |