GoConqr has a new look! Let us know what you think.

Flashcards

Machine Learning

Oliver Boom English 101 cards

Machine Learning

Cards in this deck (101)

  1. 1Supervised vs UnsupervisedLabelled vs no labels
    Unsupervised is to recognise patterns within the data
  2. 2Examples Supervised vs Non-supervisedRegression/Classification
    Clustering/Dimensionality reduction
  3. 3Linear RegressionFits a linear function called the hypothesis to the data
    Minimise the cost function of this hypothesis
    The weights of the hypothesis function called the parameters
    The hypothesis has a bias term that is not associated with values
  4. 4Cost function for linear regressionMinimsing the least squares difference between the hypothesis and the actual value
    Convex
    Optimum can be found by gradient descent
  5. 5Gradient descentDifferentiate the cost function wrt parameters and head in direction of steepest descent according to some learning rate
  6. 6The normal equationsBecause the cost function is convex can differentiate the cost function wrt the parameters and set to zero. Then solving for the parameters will give the analytical solution to the minimum of the convex function
  7. 7Logistic regressionUsed for classification problems
    Place the hypothesis function into a sigmoid function to give the probability of a class
    To solve take the derivative of the cost function wrt the parameters and apply gradient descent
  8. 8Logistic Regression cost functionThe cross-entropy loss function
  9. 9Multiclassification problemsYou classify each class in a one vs the rest manner
    Then logistic regression to get the probability of each class vs the rest and select the most probable.
  10. 10Decision boundariesWill be a polynomial that separates the different classification areas
  11. 11K-means - definition and algorithmA clustering approach
    1 - randomly initialise centroids
    2 - Assign cluster points nearest to centroids
    3 - Move centroid location to the centre of the weights of these clusters
    4 - Repeat until stopping condition (normally all points classified and centroids stable)
  12. 12Problem with k meansInitial centroids are random and clusters can be non-unique
  13. 13PCA Definition and algorithmDimensionality reduction
    1 - Normalize data
    3 - Calculate the covariance matrix
    4 - Calculate the eigenvalues of the covariance matrix
    5 - Keep the largest eigenvalues according to how many dimensions it is being reduced to. Project onto this dimensional space
  14. 14How to normalize data1 - Calculate the mean and std of the training vector
    2 - Normalise input vectors by (X-mean)/std
  15. 15Hypothesis function and g(theta*x)g is the activation function
  16. 16Non-linear activation functions and their characteristicsReLU - Non-vanishing gradient
    Sigmoid - 0-1 limit. Mainly used for final output layer. Gives a probability
    Tanh - Mean of 0 compared. Stronger gradients that sigmoid
  17. 17Why use hidden layersBecause some complex logical operations cannot be represented purely from logistic regression
  18. 18Do Single Neuron Example Do parameters in network example Linear separabilityShould be able to draw a straight decision boundary
  19. 19Number of parameters in a networkN = (number of neurons in input layer + bias) * nodes in hidden layer + ....
    for as many layers as needed
  20. 20Cost function in the binary classification caseUse the cross-entropy loss function
  21. 21Softmax functionTurns the output layer into a probability vector.
    Selects the most likely probability
  22. 22BackpropagationDifferentiate the cost function with respect to the weights
    This is done using chain rule
    Backpropagation
  23. 23Types of gradient descentBatch, mini-batch, stochastic
  24. 24Batch Mini-batch Stochastic Epoch1 - Does gradient descent calculation on the whole dataset. Computationally expensive
    2 - Performs it in small batches
    3 - Does it one training datapoint at a time, randomly. Better for escaping local minima
    4 - A iteration over the whole training set
  25. 25Neural network algorithm1 - Randomly assign training weights
    2 - Perform forwards pass to calculate the hypothesis function
    3 - Calculate the loss function
    4 - Calculate the gradients using backpropagation
    5 - Perform gradient descent to re-assign weights
  26. 26OverfittingWhere the model performs well on the training set but fails to generalize well to new data
    The hypothesis function has too many degrees of freedom considering the variability of the data
    Also called variance
  27. 27UnderfittingThe data variations are too simple considering the actual variability of the data
    Also called bias
  28. 28The capacity of a modelHow complex a relationship can be modelled
    If a model has low capacity it will underfit due to not enough parameters
    High capacity will overfit due to too many parameters
  29. 29GeneralizationThe ability of a model to perform well on unseen data
  30. 30What will a good ML algorithm do with respect to training error and test errorMake the training error small and the discrepancy between training error and test error also small.
    Failure to do the first is underfitting, failure to do the second is overfitting
  31. 31RegularisationAny modification which improves generalization while not decreasing the training error
    Want to decrease the variance while not significantly increasing the bias
  32. 32Regularisation examplesL1/L2
    Dropout - drop hidden layers according to probability. Like sampling from an ensemble. Don't use at test time
    Data Augmentation -
  33. 33Types of regularisationL1 - The absolute value of the weights
    Also called ridge regression
    L2 - The squared value of the weights
    Also called lasso regression
    Gamma - the weight decay term
    The weights are summed and added to the cost function to incentivise having a small number of weights
  34. 34Effect of changing the regularisation parameterIncreasing gamma results in the weights tending to zero and therefore the function approximating a linear function.
  35. 35HyperparameterA value who's set before the training parameters begin
  36. 36Why the training/validation splitTraining - Used to train the nn
    Validation - Used to test the trained set to determine optimal hyperparameters
    The choose the optimal hyperparameters/architecture to take onto the test set
  37. 37Sampling from the training set in classification problems How to do this for big/small datasetsWant an even representation of each class in the training, validation and ideally test sets
    Smaller - Random stratified sampling (first sort population into strata then randomly sample)
    Large - Can just randomly shuffle, as the sample size will mean that the randomness will even out
  38. 38Bias vs variance Error vs Parameters plotBias vs variance Error vs Parameters plot
  39. 39Accuracy vs Regularization strengthAccuracy vs Regularization strength
  40. 40Large vs small neural networks Pros/ConsLarge - Computationally expensive. Overfit. Combat with regularisation
    Small - Computationally cheap. Underfit. Decrease regularisation underparameters, or add more features
  41. 41K fold validation - whyOnly one validation set is not very robust
    Especially for smaller datasets, the variability could result in inaccurate validation scores
    K fold validation - why
  42. 42Issues with feed forwards neural networksThey lose their spatial organisation.
    Unlike convolutional neural networks
  43. 43Do convolution exampleDo convolution example
  44. 44Idea behind cnnsParameterize the filter and optimise it's coefficients
    W (filter) convolve x (input) = y (output)
  45. 45Bias and non-linearityAdd a bias term for each filter always unless specified
    Apply an activation function to use non-linearity
  46. 46Key parametersStride and padding
  47. 47Equation to decide the convolution parametersCan also have a filter for each rgb channel. However the output is a singular channelEquation to decide the convolution parameters
  48. 48If my input Image is 50x50 with 10 channels, and if I apply 25 filters each of size 3x3x10 with a stride of 1, no padding, what is the size and number of channels of the output image? Is the bias included48x48 with 25 channels
    The bias has nothing to do with the size of the output image, it is to do with the weights
  49. 49How many weights are adjusted per cnn layerNumber of filters x (size of the filter + 1 for bias)
  50. 50Is the number of parameters related to the input image sizeNo it is not
    The number of parameters is the same as the degrees of freedom
  51. 51How many weight terms for this network27301How many weight terms for this network
  52. 52Types of layers in a convolutional networkConvolutional layers
    Fully connected layers
    Pooling layer
  53. 53How are the parameters optimizedIn the same way as feed forwards networks. Backpropagate to find gradients and perform gradient descent.
  54. 54Transfer learningTrain on existing network and then retrain final layer of network on images of interest
  55. 55Random variableA variable that is associated with a non-deterministic process. Ie it's picked according to a distribution
  56. 56Probability density functionProbability density function
  57. 57Mean of pdf Std of pdfMean of pdf Std of pdf
  58. 58Covariance of two distributions rhoRho is the correlation coefficient
    if rho = 0 no correlation
    if rho = 1 or -1 perfect linear correlation
    Covariance of two distributions rho
  59. 59SigmaThe variance-covariance matrixSigma
  60. 60Discrete random variablesTake finite values associated to certain probabilities
  61. 61Expectation of DRVE(X) = p * x
    E(X^2) = p * x^2
    Var = E[X^2] - mu^2
  62. 62Bernoulli Variablemean - p
    Variance - p*q
  63. 63IIDIndependently and identically distributed
    If each RV has the same distribution and are all mutually independent
  64. 64Maximum likelihoodMeans choosing the parameters such that m samples maximises their likelihood
  65. 65Likelihood of an image Maximum likelihood ML of a gaussianpdf(image input)
    So maximum likelihood is just choosing weights that maximise the sum of all the likelihoods across the data set
    Maximising likelihood leads to minimising cross-entropy loss for classification or L2 norm for regression
  66. 66—Do exerciseDo exercise
  67. 67Lognormal distributionX is lognormally distributed if log(X) is normally distributed
  68. 68Monte Carlo and RVsYou can use Monte Carlo simulation to pick RVs according to some distribution
  69. 69KL divergenceA method to compare two RVs - Seeing the similarity between two distributions
    It's value is 0 if the RVs are identical
    It is assymetrical - think about the normal gaussian videos as they came closer togehter
  70. 70KL vs Maximum likelihoodFinding the parameters which maximise likelihood is the equivalent to finding the parameters which minimize KL divergence
  71. 71PCA vs AutoencoderPCA can only represent linear mapping
    Autoencoder can do non-linear
  72. 72Fully connected Layer in CNNSame as in a forward neural network. All the neurons in the input layer connect to all the neurons in the output layers
  73. 73Pooling LayersTakes the maximum values in a given filter size. Makes the feature dimensions smaller while still recognising key features. It also reduces the number of parameters and computations
  74. 74Latent spaceWant to represent an image by a set of vectors which are much smaller than the dimension of the original image
    Like PCA but also works for non-linear manifolds
  75. 75Autoencoders ProcessAutoencoders Process
  76. 76Difference between encoder and decoder convolutionEncoder reduced dimensionality
    Decoder increases dimensionality
  77. 77Does the convolution operation include a bias termYes it doesDoes the convolution operation include a bias term
  78. 78How to get the decoded x values from y and WHow to get the decoded x values from y and W
  79. 79Example Calculate the direct convolutionNext to the transposeExample Calculate the direct convolutionExample Calculate the direct convolution
  80. 80How to calculate the transposed convolutionHow to calculate the transposed convolution
  81. 81What do VAE generateNew images that belong to the same general pdf as those of the training set
  82. 82Encoding StepThe recognition networkEncoding Step
  83. 83Decoding StepThe generation networkDecoding Step
  84. 84How do you calculate mean and std of xUsing a neural network where the parameters maximise the likelihood
  85. 85ELBOThe evidence lower bound. The lower bound of the log likelihood for a single image
    Made up of the reconstruction likelihood and the KL divergence
  86. 86Reconstruction likelihoodQuantifying the quality of the trip from training image to latent vector pdf
  87. 87KL Divergence for ELBOAims to spread the range of latent vectors associated to each image
  88. 88How can you calculate the expectation of a pdf in variational autoencodingUse monte carlo to sample enough times to get the expectation
  89. 89VAE FlowchatVAE Flowchat
  90. 90MMD for GANSMaximum mean discrepancy compares two samples by comparing the mean in the feature space
  91. 91GANs discriminator cost functionBinary cross entropy equivilent
  92. 92Why might generators not be greatMiss modes of the distribution - called mode collapse
  93. 93Which is the best method of GANUnrolled is better than GAN
  94. 94Smooth class GANsCan incorporate class labels into GANs and have smooth interpolation to have smooth inter-class results
  95. 95Unpaired domain transferUsed to map one domain onto another
  96. 96VAE vs GANsVAE vs GANs
  97. 97Are kernels linear or non-linearThey are non-linear because a transformation is applied
  98. 98Number of output neurons in a convolutional filterIs the same as the output shape
  99. 99Parameters/weights vs Output Neurons for a convolutional neural networkParameters/weights is the number of filters * (size of filter + 1) it has nothing to do with the size of the input image. Because it is the convolutional filter that is being parameterized.
    The number of neurons which is a much larger number and is proportional to the size of the input image
  100. 100Normal distributionNormal distribution
  101. 101Log likelihood for a variaitional autoencoderThe measure of the effectiveness with which the decoder has learned to reconstruct an input image xx given its latent representation zz.

Information

Description
Flashcards on Machine Learning, created by Oliver Boom on 27/05/2019.
Created by
Oliver Boom
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?