SYMBOL INDEX (412 symbols across 9 files) FILE: code/chapter 11.py function cal_conf_matrix (line 10) | def cal_conf_matrix(labels, preds): function cal_PRF1 (line 30) | def cal_PRF1(labels, preds): function cal_PRcurve (line 41) | def cal_PRcurve(labels, preds): function cal_ROCcurve (line 62) | def cal_ROCcurve(labels, preds): function timeit (line 84) | def timeit(func): function area_auc (line 98) | def area_auc(labels, preds): function naive_auc (line 113) | def naive_auc(labels, preds): class KernelBase (line 133) | class KernelBase(ABC): method __init__ (line 135) | def __init__(self): method _kernel (line 141) | def _kernel(self, X, Y): method __call__ (line 144) | def __call__(self, X, Y=None): method __str__ (line 147) | def __str__(self): method summary (line 152) | def summary(self): class RBFKernel (line 160) | class RBFKernel(KernelBase): method __init__ (line 162) | def __init__(self, sigma=None): method _kernel (line 170) | def _kernel(self, X, Y=None): class KernelInitializer (line 189) | class KernelInitializer(object): method __init__ (line 191) | def __init__(self, param=None): method __call__ (line 194) | def __call__(self): class GPRegression (line 205) | class GPRegression: method __init__ (line 209) | def __init__(self, kernel="RBFKernel", sigma=1e-10): method fit (line 214) | def fit(self, X, y): method predict (line 229) | def predict(self, X_star, conf_interval=0.95): class BayesianOptimization (line 252) | class BayesianOptimization: method __init__ (line 254) | def __init__(self): method acquisition_function (line 257) | def acquisition_function(self, Xsamples): method opt_acquisition (line 263) | def opt_acquisition(self, X, n_samples=20): method fit (line 273) | def fit(self, f, X, y): FILE: code/chapter5.py class NaiveBayes (line 7) | class NaiveBayes(): method __init__ (line 9) | def __init__(self): method fit (line 14) | def fit(self, X, y): method _calculate_prior (line 27) | def _calculate_prior(self, c): method _calculate_likelihood (line 34) | def _calculate_likelihood(self, mean, var, X): method _calculate_probabilities (line 44) | def _calculate_probabilities(self, X): method predict (line 57) | def predict(self, X): method score (line 61) | def score(self, X, y): function Sigmoid (line 68) | def Sigmoid(x): class LogisticRegression (line 71) | class LogisticRegression(): method __init__ (line 73) | def __init__(self, learning_rate=.1): method _initialize_parameters (line 78) | def _initialize_parameters(self, X): method fit (line 84) | def fit(self, X, y, n_iterations=4000): method predict (line 93) | def predict(self, X): method score (line 97) | def score(self, X, y): function linear_kernel (line 107) | def linear_kernel(**kwargs): function polynomial_kernel (line 115) | def polynomial_kernel(power, coef, **kwargs): function rbf_kernel (line 123) | def rbf_kernel(gamma, **kwargs): class SupportVectorMachine (line 132) | class SupportVectorMachine(): method __init__ (line 134) | def __init__(self, kernel=linear_kernel, power=4, gamma=None, coef=4): method fit (line 144) | def fit(self, X, y): method predict (line 192) | def predict(self, X): method score (line 204) | def score(self, X, y): class KNN (line 211) | class KNN(): method __init__ (line 213) | def __init__(self, k=10): method fit (line 216) | def fit(self, X, y): method predict (line 222) | def predict(self, X): method predict (line 242) | def predict(self, X): method score (line 254) | def score(self, X, y): class DecisionNode (line 261) | class DecisionNode(): method __init__ (line 263) | def __init__(self, feature_i=None, threshold=None, function divide_on_feature (line 272) | def divide_on_feature(X, feature_i, threshold): class DecisionTree (line 288) | class DecisionTree(object): method __init__ (line 290) | def __init__(self, min_samples_split=2, min_impurity=1e-7, method fit (line 300) | def fit(self, X, y): method _build_tree (line 304) | def _build_tree(self, X, y, current_depth=0): method predict_value (line 362) | def predict_value(self, x, tree=None): method predict (line 386) | def predict(self, X): method score (line 390) | def score(self, X, y): method print_tree (line 395) | def print_tree(self, tree=None, indent=" "): function calculate_entropy (line 412) | def calculate_entropy(y): function calculate_gini (line 423) | def calculate_gini(y): class ClassificationTree (line 433) | class ClassificationTree(DecisionTree): method _calculate_gini_index (line 437) | def _calculate_gini_index(self, y, y1, y2): method _calculate_information_gain (line 449) | def _calculate_information_gain(self, y, y1, y2): method _majority_vote (line 460) | def _majority_vote(self, y): method fit (line 473) | def fit(self, X, y): function calculate_mse (line 479) | def calculate_mse(y): function calculate_variance (line 483) | def calculate_variance(y): class RegressionTree (line 489) | class RegressionTree(DecisionTree): method _calculate_mse (line 493) | def _calculate_mse(self, y, y1, y2): method _calculate_variance_reduction (line 505) | def _calculate_variance_reduction(self, y, y1, y2): method _mean_of_y (line 517) | def _mean_of_y(self, y): method fit (line 524) | def fit(self, X, y): class PCA (line 531) | class PCA(): method __init__ (line 533) | def __init__(self): method fit (line 536) | def fit(self, X, n_components): function distEclud (line 553) | def distEclud(x,y): function randomCent (line 559) | def randomCent(dataSet,k): class KMeans (line 570) | class KMeans(): method __init__ (line 572) | def __init__(self): method fit (line 576) | def fit(self, dataSet, k): FILE: code/chapter6.py function sigmoid (line 15) | def sigmoid(x): function softmax (line 19) | def softmax(x): class LayerBase (line 24) | class LayerBase(ABC): method __init__ (line 26) | def __init__(self, optimizer="sgd"): method _init_params (line 34) | def _init_params(self, **kwargs): method forward (line 41) | def forward(self, X, **kwargs): method backward (line 48) | def backward(self, out, **kwargs): method flush_gradients (line 54) | def flush_gradients(self): method update (line 65) | def update(self): class FullyConnected (line 74) | class FullyConnected(LayerBase): method __init__ (line 79) | def __init__(self, n_out, acti_fn, init_w, optimizer=None): method _init_params (line 96) | def _init_params(self): method forward (line 104) | def forward(self, X, retain_derived=True): method backward (line 126) | def backward(self, dLda, retain_grads=True): method _bwd (line 149) | def _bwd(self, dLda, X): method hyperparams (line 162) | def hyperparams(self): class ObjectiveBase (line 178) | class ObjectiveBase(ABC): method __init__ (line 180) | def __init__(self): method loss (line 184) | def loss(self, y_true, y_pred): method grad (line 191) | def grad(self, y_true, y_pred, **kwargs): class SquaredError (line 198) | class SquaredError(ObjectiveBase): method __init__ (line 202) | def __init__(self): method __call__ (line 205) | def __call__(self, y_true, y_pred): method __str__ (line 208) | def __str__(self): method loss (line 212) | def loss(y_true, y_pred): method grad (line 222) | def grad(y_true, y_pred, z, acti_fn): class CrossEntropy (line 227) | class CrossEntropy(ObjectiveBase): method __init__ (line 231) | def __init__(self): method __call__ (line 234) | def __call__(self, y_true, y_pred): method __str__ (line 237) | def __str__(self): method loss (line 241) | def loss(y_true, y_pred): method grad (line 253) | def grad(y_true, y_pred): function minibatch (line 259) | def minibatch(X, batchsize=256, shuffle=True): class DFN (line 277) | class DFN(object): method __init__ (line 279) | def __init__( method _set_params (line 294) | def _set_params(self): method forward (line 314) | def forward(self, X_train): method backward (line 322) | def backward(self, grad): method update (line 330) | def update(self): method flush_gradients (line 338) | def flush_gradients(self, curr_loss=None): method fit (line 345) | def fit(self, X_train, y_train, n_epochs=20, batch_size=64, verbose=Fa... method evaluate (line 389) | def evaluate(self, X_test, y_test, batch_size=128): method hyperparams (line 402) | def hyperparams(self): FILE: code/chapter7.py class RegularizerBase (line 9) | class RegularizerBase(ABC): method __init__ (line 11) | def __init__(self, **kwargs): method loss (line 15) | def loss(self, **kwargs): method grad (line 19) | def grad(self, **kwargs): class L1Regularizer (line 22) | class L1Regularizer(RegularizerBase): method __init__ (line 24) | def __init__(self, lambd=0.001): method loss (line 28) | def loss(self, params): method grad (line 36) | def grad(self, params): class L2Regularizer (line 41) | class L2Regularizer(RegularizerBase): method __init__ (line 43) | def __init__(self, lambd=0.001): method loss (line 47) | def loss(self, params): method grad (line 53) | def grad(self, params): class RegularizerInitializer (line 58) | class RegularizerInitializer(object): method __init__ (line 60) | def __init__(self, regular_name="l2"): method __call__ (line 63) | def __call__(self): class Image (line 77) | class Image(object): method __init__ (line 79) | def __init__(self, image): method _set_params (line 82) | def _set_params(self, image): method Translation (line 88) | def Translation(self, delta_x, delta_y): method Resize (line 100) | def Resize(self, alpha): method HorMirror (line 111) | def HorMirror(self): method VerMirror (line 119) | def VerMirror(self): method Rotate (line 127) | def Rotate(self, angle): method operate (line 138) | def operate(self): method __call__ (line 153) | def __call__(self, act): function early_stopping (line 171) | def early_stopping(valid): function bootstrap_sample (line 183) | def bootstrap_sample(X, Y): class BaggingModel (line 188) | class BaggingModel(object): method __init__ (line 190) | def __init__(self, n_models): method fit (line 198) | def fit(self, X, Y): method predict (line 207) | def predict(self, X): method _vote (line 211) | def _vote(self, predictions): method evaluate (line 215) | def evaluate(self, X_test, y_test): class Dropout (line 224) | class Dropout(ABC): method __init__ (line 226) | def __init__(self, wrapped_layer, p): method _init_wrapper_params (line 237) | def _init_wrapper_params(self): method flush_gradients (line 241) | def flush_gradients(self): method update (line 247) | def update(self): method forward (line 253) | def forward(self, X, is_train=True): method backward (line 266) | def backward(self, dLda): method hyperparams (line 270) | def hyperparams(self): function get_random_subsets (line 287) | def get_random_subsets(X, y, n_subsets, replacements=True): class Bagging (line 309) | class Bagging(): method __init__ (line 313) | def __init__(self, n_estimators=100, max_features=None, min_samples_sp... method fit (line 330) | def fit(self, X, y): method predict (line 338) | def predict(self, X): method score (line 352) | def score(self, X, y): class RandomForest (line 359) | class RandomForest(): method __init__ (line 363) | def __init__(self, n_estimators=100, max_features=None, min_samples_sp... method fit (line 381) | def fit(self, X, y): method predict (line 401) | def predict(self, X): method score (line 417) | def score(self, X, y): class DecisionStump (line 425) | class DecisionStump(): method __init__ (line 427) | def __init__(self): class Adaboost (line 433) | class Adaboost(): method __init__ (line 437) | def __init__(self, n_estimators=5): method fit (line 441) | def fit(self, X, y): method predict (line 489) | def predict(self, X): method score (line 504) | def score(self, X, y): class Loss (line 511) | class Loss(ABC): method __init__ (line 513) | def __init__(self): method loss (line 517) | def loss(self, y_true, y_pred): method grad (line 521) | def grad(self, y, y_pred): class SquareLoss (line 524) | class SquareLoss(Loss): method __init__ (line 526) | def __init__(self): method loss (line 529) | def loss(self, y, y_pred): method grad (line 532) | def grad(self, y, y_pred): method hess (line 535) | def hess(self, y, y_pred): class CrossEntropyLoss (line 538) | class CrossEntropyLoss(Loss): method __init__ (line 540) | def __init__(self): method loss (line 543) | def loss(self, y, y_pred): method grad (line 546) | def grad(self, y, y_pred): method hess (line 549) | def hess(self, y, y_pred): function softmax (line 553) | def softmax(x): function line_search (line 558) | def line_search(self, y, y_pred, h_pred): function to_categorical (line 564) | def to_categorical(x, n_classes=None): class GradientBoostingDecisionTree (line 575) | class GradientBoostingDecisionTree(object): method __init__ (line 579) | def __init__(self, n_estimators, learning_rate=1, min_samples_split=2, method fit (line 594) | def fit(self, X, Y): method predict (line 629) | def predict(self, X): method score (line 643) | def score(self, X, y): class GradientBoostingRegressor (line 649) | class GradientBoostingRegressor(GradientBoostingDecisionTree): method __init__ (line 651) | def __init__(self, n_estimators=200, learning_rate=1, min_samples_spli... class GradientBoostingClassifier (line 662) | class GradientBoostingClassifier(GradientBoostingDecisionTree): method __init__ (line 664) | def __init__(self, n_estimators=200, learning_rate=1, min_samples_spli... class XGBoostRegressionTree (line 676) | class XGBoostRegressionTree(DecisionTree): method __init__ (line 680) | def __init__(self, min_samples_split=2, min_impurity=1e-7, method _split (line 689) | def _split(self, y): method _gain (line 695) | def _gain(self, y, y_pred): method _gain_by_taylor (line 701) | def _gain_by_taylor(self, y, y1, y2): method _approximate_update (line 712) | def _approximate_update(self, y): method fit (line 720) | def fit(self, X, y): class XGBoost (line 726) | class XGBoost(object): method __init__ (line 730) | def __init__(self, n_estimators=200, learning_rate=0.001, min_samples_... method fit (line 746) | def fit(self, X, Y): method predict (line 783) | def predict(self, X): method score (line 797) | def score(self, X, y): class XGBRegressor (line 803) | class XGBRegressor(XGBoost): method __init__ (line 805) | def __init__(self, n_estimators=200, learning_rate=1, min_samples_spli... class XGBClassifier (line 818) | class XGBClassifier(XGBoost): method __init__ (line 820) | def __init__(self, n_estimators=200, learning_rate=1, min_samples_spli... FILE: code/chapter8.py class BatchNorm1D (line 11) | class BatchNorm1D(LayerBase): method __init__ (line 13) | def __init__(self, momentum=0.9, epsilon=1e-5, optimizer=None): method _init_params (line 36) | def _init_params(self): method reset_running_stats (line 54) | def reset_running_stats(self): method forward (line 58) | def forward(self, X, is_train=True, retain_derived=True): method backward (line 94) | def backward(self, dLda, retain_grads=True): method _bwd (line 117) | def _bwd(self, dLda, X): method hyperparams (line 136) | def hyperparams(self): FILE: code/chapter9.py function calc_pad_dims_sameconv_2D (line 8) | def calc_pad_dims_sameconv_2D(X_shape, out_dim, kernel_shape, stride, di... function pad2D (line 52) | def pad2D(X, pad, kernel_shape=None, stride=None, dilation=1): function conv2D (line 95) | def conv2D(X, W, stride, pad, dilation=1): function _im2col_indices (line 145) | def _im2col_indices(X_shape, fr, fc, p, s, d=1): function im2col (line 177) | def im2col(X, W_shape, pad, stride, dilation=1): function conv2D_gemm (line 214) | def conv2D_gemm(X, W, stride=0, pad='same', dilation=1): class Conv2D (line 256) | class Conv2D(LayerBase): method __init__ (line 258) | def __init__( method _init_params (line 300) | def _init_params(self): method forward (line 310) | def forward(self, X, retain_derived=True): method backward (line 341) | def backward(self, dLda, retain_grads=True): method hyperparams (line 398) | def hyperparams(self): function col2im (line 417) | def col2im(X_col, X_shape, W_shape, pad, stride, dilation=0): class Conv2D_gemm (line 452) | class Conv2D_gemm(LayerBase): method __init__ (line 454) | def __init__( method _init_params (line 496) | def _init_params(self): method forward (line 506) | def forward(self, X, retain_derived=True): method backward (line 537) | def backward(self, dLda, retain_grads=True): method _bwd (line 565) | def _bwd(self, dLda, X, Y): method hyperparams (line 586) | def hyperparams(self): class Pool2D (line 605) | class Pool2D(LayerBase): method __init__ (line 607) | def __init__(self, kernel_shape, stride=1, pad=0, mode="max", optimize... method _init_params (line 629) | def _init_params(self): method forward (line 633) | def forward(self, X, retain_derived=True): method backward (line 678) | def backward(self, dLdy, retain_grads=True): method hyperparams (line 729) | def hyperparams(self): class Flatten (line 747) | class Flatten(LayerBase): method __init__ (line 749) | def __init__(self, keep_dim="first", optimizer=None): method _init_params (line 764) | def _init_params(self): method forward (line 770) | def forward(self, X, retain_derived=True): method backward (line 785) | def backward(self, dLdy, retain_grads=True): method hyperparams (line 803) | def hyperparams(self): class LeNet (line 815) | class LeNet(object): method __init__ (line 817) | def __init__( method _set_params (line 859) | def _set_params(self): method forward (line 916) | def forward(self, X_train): method backward (line 924) | def backward(self, grad): method update (line 932) | def update(self): method flush_gradients (line 940) | def flush_gradients(self, curr_loss=None): method fit (line 947) | def fit(self, X_train, y_train, n_epochs=20, batch_size=64, verbose=Fa... method evaluate (line 991) | def evaluate(self, X_test, y_test, batch_size=128): method hyperparams (line 1004) | def hyperparams(self): class LeNet_gemm (line 1029) | class LeNet_gemm(object): method __init__ (line 1031) | def __init__( method _set_params (line 1073) | def _set_params(self): method forward (line 1130) | def forward(self, X_train): method backward (line 1138) | def backward(self, grad): method update (line 1146) | def update(self): method flush_gradients (line 1154) | def flush_gradients(self, curr_loss=None): method fit (line 1161) | def fit(self, X_train, y_train, n_epochs=20, batch_size=64, verbose=Fa... method evaluate (line 1205) | def evaluate(self, X_test, y_test, batch_size=128): method hyperparams (line 1218) | def hyperparams(self): FILE: code/method/activation/activation.py class ActivationBase (line 6) | class ActivationBase(ABC): method __init__ (line 8) | def __init__(self, **kwargs): method __call__ (line 11) | def __call__(self, z): method forward (line 17) | def forward(self, z): method grad (line 21) | def grad(self, x, **kwargs): class Sigmoid (line 25) | class Sigmoid(ActivationBase): method __init__ (line 30) | def __init__(self): method __str__ (line 33) | def __str__(self): method forward (line 36) | def forward(self, z): method grad (line 39) | def grad(self, x): class Tanh (line 43) | class Tanh(ActivationBase): method __init__ (line 48) | def __init__(self): method __str__ (line 51) | def __str__(self): method forward (line 54) | def forward(self, z): method grad (line 57) | def grad(self, x): class ReLU (line 61) | class ReLU(ActivationBase): method __init__ (line 68) | def __init__(self): method __str__ (line 71) | def __str__(self): method forward (line 74) | def forward(self, z): method grad (line 77) | def grad(self, x): class LeakyReLU (line 81) | class LeakyReLU(ActivationBase): method __init__ (line 88) | def __init__(self, alpha=0.3): method __str__ (line 92) | def __str__(self): method forward (line 95) | def forward(self, z): method grad (line 100) | def grad(self, x): class Affine (line 106) | class Affine(ActivationBase): method __init__ (line 111) | def __init__(self, slope=1, intercept=0): method __str__ (line 116) | def __str__(self): method forward (line 119) | def forward(self, z): method grad (line 122) | def grad(self, x): class SoftPlus (line 126) | class SoftPlus(ActivationBase): method __init__ (line 131) | def __init__(self): method __str__ (line 134) | def __str__(self): method forward (line 137) | def forward(self, z): method grad (line 140) | def grad(self, x): class ELU (line 144) | class ELU(ActivationBase): method __init__ (line 151) | def __init__(self, alpha=1.0): method __str__ (line 155) | def __str__(self): method forward (line 158) | def forward(self, z): method grad (line 161) | def grad(self, x): class Exponential (line 165) | class Exponential(ActivationBase): method __init__ (line 170) | def __init__(self): method __str__ (line 173) | def __str__(self): method forward (line 176) | def forward(self, z): method grad (line 179) | def grad(self, x): class SELU (line 183) | class SELU(ActivationBase): method __init__ (line 190) | def __init__(self): method __str__ (line 196) | def __str__(self): method forward (line 199) | def forward(self, z): method grad (line 202) | def grad(self, x): class HardSigmoid (line 208) | class HardSigmoid(ActivationBase): method __init__ (line 216) | def __init__(self): method __str__ (line 219) | def __str__(self): method forward (line 222) | def forward(self, z): method grad (line 225) | def grad(self, x): class ActivationInitializer (line 229) | class ActivationInitializer(object): method __init__ (line 231) | def __init__(self, acti_name="affine(slope=1, intercept=0)"): method __call__ (line 234) | def __call__(self): FILE: code/method/optimizer/optimizer.py class OptimizerBase (line 6) | class OptimizerBase(ABC): method __init__ (line 8) | def __init__(self): method __call__ (line 11) | def __call__(self, params, params_grad, params_name): method update (line 21) | def update(self, params, params_grad, params_name): class SGD (line 25) | class SGD(OptimizerBase): method __init__ (line 30) | def __init__(self, lr=0.01): method __str__ (line 35) | def __str__(self): method update (line 38) | def update(self, params, params_grad, params_name): method hyperparams (line 43) | def hyperparams(self): class Momentum (line 49) | class Momentum(OptimizerBase): method __init__ (line 51) | def __init__( method __str__ (line 64) | def __str__(self): method update (line 67) | def update(self, param, param_grad, param_name): method hyperparams (line 79) | def hyperparams(self): class AdaGrad (line 87) | class AdaGrad(OptimizerBase): method __init__ (line 89) | def __init__(self, lr=0.001, eps=1e-7, **kwargs): method __str__ (line 100) | def __str__(self): method update (line 103) | def update(self, param, param_grad, param_name): method hyperparams (line 116) | def hyperparams(self): class RMSProp (line 124) | class RMSProp(OptimizerBase): method __init__ (line 126) | def __init__( method __str__ (line 141) | def __str__(self): method update (line 146) | def update(self, param, param_grad, param_name): method hyperparams (line 160) | def hyperparams(self): class AdaDelta (line 169) | class AdaDelta(OptimizerBase): method __init__ (line 171) | def __init__( method __str__ (line 186) | def __str__(self): method update (line 189) | def update(self, param, param_grad, param_name): method hyperparams (line 207) | def hyperparams(self): class Adam (line 215) | class Adam(OptimizerBase): method __init__ (line 217) | def __init__( method __str__ (line 239) | def __str__(self): method update (line 244) | def update(self, param, param_grad, param_name, cur_loss=None): method hyperparams (line 271) | def hyperparams(self): class OptimizerInitializer (line 281) | class OptimizerInitializer(ABC): method __init__ (line 283) | def __init__(self, opti_name="sgd"): method __call__ (line 286) | def __call__(self): FILE: code/method/weight/weight.py function calc_fan (line 6) | def calc_fan(weight_shape): class random_uniform (line 24) | class random_uniform: method __init__ (line 31) | def __init__(self, b=1.0): method __call__ (line 34) | def __call__(self, weight_shape): class random_normal (line 38) | class random_normal: method __init__ (line 46) | def __init__(self, std=0.01): method __call__ (line 49) | def __call__(self, weight_shape): class he_uniform (line 74) | class he_uniform: method __init__ (line 81) | def __init__(self): method __call__ (line 84) | def __call__(self, weight_shape): class he_normal (line 90) | class he_normal: method __init__ (line 97) | def __init__(self): method __call__ (line 100) | def __call__(self, weight_shape): class glorot_uniform (line 131) | class glorot_uniform: method __init__ (line 139) | def __init__(self, gain=1.0): method __call__ (line 142) | def __call__(self, weight_shape): class glorot_normal (line 148) | class glorot_normal: method __init__ (line 156) | def __init__(self, gain=1.0): method __call__ (line 159) | def __call__(self, weight_shape): function truncated_normal (line 191) | def truncated_normal(mean, std, out_shape): class WeightInitializer (line 209) | class WeightInitializer(object): method __init__ (line 211) | def __init__(self, mode="he_normal"): method __call__ (line 235) | def __call__(self, weight_shape):