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
S(\alpha, \beta) = | |
\left( \sum_i^n x_i^2 \right) \alpha^2 + n\beta^2 | |
+ 2 \left( \sum_i^n x_i \right)\alpha \beta | |
- 2 \left( \sum_i^n x_i y_i \right)\alpha | |
- 2 \left( \sum_i^n y_i \right)\beta | |
+ \sum_i^n y_i^2 |
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.pyplot as plt | |
import matplotlib.cm as cm |
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.pyplot as plt | |
import matplotlib.cm as cm |
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
C = \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\} |
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
[Predicted Data List] | |
2.0 | |
0.0 | |
9.0 | |
9.0 | |
3.0 | |
7.0 | |
0.0 | |
3.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
Tested Data | Predicted Data | Judge | |
---|---|---|---|
2 | 2 | ok | |
0 | 0 | ok | |
9 | 9 | ok | |
0 | 8 | fail | |
3 | 3 | ok | |
7 | 7 | ok | |
0 | 0 | ok | |
3 | 3 | ok | |
0 | 0 | ok |
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.pyplot as plt | |
import matplotlib.cm as cm | |
from collections import defaultdict | |
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.pyplot as plt | |
from moviepy.editor import * | |
from matplotlib import animation as ani | |
sigma = 1 | |
mu = 3 | |
def norm_dist_neg(x): | |
return -1./(np.sqrt(2 * np.pi) * sigma)* np.exp(-0.5*((x-mu)**2)/((sigma**2))) |
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
\nabla f = \frac{d f({\bf x})}{d {\bf x}} = \left[ \begin{array}{r} \frac{\partial f}{\partial x_1} \\ ... \\ \frac{\partial f}{\partial x_2} \end{array} \right] |
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
%matplotlib inline | |
import numpy as np | |
import sklearn.decomposition as decomp | |
import matplotlib.pyplot as plt | |
import matplotlib.cm as cm | |
# function definitions | |
class DigitData: | |
def __init__(self, data): |
OlderNewer