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 matplotlib as mpl | |
import matplotlib.pyplot as plt | |
from matplotlib.colors import ListedColormap as licama | |
def rabaisi(x1,y1,x2,y2,si): | |
n = len(x1) | |
xt = np.where(np.arange(n)%2,x1,x2) | |
yt = np.where(np.arange(n)%2,y1,y2) | |
plt.tripcolor(xt,yt,np.arange(3)+np.arange(n-2)[:,None],facecolors=np.ones(n-2),cmap=licama([si])) |
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 softmax(x): | |
exp_x = np.exp(x.T-x.max(1)) | |
return (exp_x/exp_x.sum(0)).T | |
class Sgd: | |
def __init__(self,eta=0.01): | |
self.eta = eta | |
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
[1276 0 4 2 3 9 8 3 6 1] | |
[ 0 1556 11 4 1 5 0 4 17 6] | |
[ 9 16 1225 21 11 3 15 16 26 6] | |
[ 4 12 33 1269 0 45 3 17 34 10] | |
[ 5 7 11 2 1245 3 16 5 12 56] | |
[ 12 6 16 44 10 1105 25 10 39 13] | |
[ 12 3 9 0 5 16 1343 2 4 3] | |
[ 6 4 20 5 14 1 1 1377 1 32] | |
[ 6 34 12 36 7 24 10 5 1242 14] | |
[ 10 6 6 20 35 12 1 46 10 1273] |