Huawei ML FAQ Again
More annotation from Huawei Mock Exam — AISeries —Episode #02
Hi, this post is based on careful scrutiny of the HCIA-AI V3.0 Mock Exam.
Here I comment on what I get wrong during my test…maybe that would be useful for you too o/
These are questions answered here:
Index:01 — What Is Huawei HiLens?
02 — What is Graph-Based Segmentation? Does MindSpore have automatic Graph segmentation?
03 — What does Softmax activation do?
04 — How to Use Grid Search in scikit-learn? What does it take to use it in ML?
05 - Which is better Adam or SGD?
06 — What is the idea behind Ensemble Methods?
07 — How can you Improve the Accuracy of the Machine Learning Model?
08 — What are Feature Engineering techniques?
09 — What is Feature Selection? What is the best feature selection method?
10 — What is a Generative Algorithm? And Discriminative Algorithm?
11 — What is a Convolution in Math?
12 — What are the 3 key concepts of CNN (Convolutional neural networks)? Can you explain each one succinctly? How does it work?
13 — How do you reduce high variance in machine learning? What models do recommendations exist?
14 — How do I stop Overfitting?
15 — How Do I Choose an Authentication Mode in Huawei Cloud Services?
16 — What is Keras? What is Eager Execution in TensorFlow? Is TensorFlow distributed?
Let’s get it on!
01Q&A —What Is Huawei HiLens?
Huawei HiLens is a multimodal AI development platform that enables device-cloud synergy. It provides an easy-to-use framework, out-of-the-box environment, cloud-based management console, and AI skill market. With Huawei HiLens, you can easily develop and deploy visual and auditory AI applications online, and manage a multitude of connected computing devices.
02Q&A —What is Graph-Based Segmentation? Does MindSpore have automatic Graph segmentation?
In digital image processing and computer vision, image segmentation is the process of partitioning a digital image into multiple segments (sets of pixels, also known as image objects).The analysis of digital scenes often requires the segmentation of connected components, named objects, in images and videos.The goal of segmentation is to simplify and/or change the representation of an image into something that is more meaningful and easier to analyzeYes, MindSpore have automatic graph segmentation.
03Q&A —What does Softmax activation do?
Softmax it's an activation function.Softmax is used as the activation function for multi-class classification problems where class membership is required on more than two class labels;Softmax units naturally represent a probability distribution over a discrete variable with k possible values, so they may be used as a kind of switch.
04Q&A — How to Use Grid Search in scikit-learn? What does it take to use it in ML?
Grid search is a model hyperparameter optimization technique.Below is an example of defining a simple grid search:
param_grid = dict(epochs=[10,20,30])grid = GridSearchCV(estimator=model, param_grid=param_grid, n_jobs=-1, cv=3)grid_result = grid.fit(X, Y)
05Q&A —Which is better Adam or SGD?
Adam is a replacement optimization algorithm for stochastic gradient descent for training deep learning models. Adam combines the best properties of the AdaGrad and RMSProp algorithms to provide an optimization algorithm that can handle sparse gradients on noisy problems.Keras provides the SGD class that implements the Stochastic Gradient Descent optimizer with a learning rate and momentum.Adam is great, it's much faster than SGD, the default hyperparameters usually works fine, but it has its own pitfall too. Many accused Adam has convergence problems that often SGD + momentum can converge better with longer training time. We often see a lot of papers in 2018 and 2019 were still using SGD.Adam is the best among the adaptive optimizers in most of the cases. Good with sparse data: the adaptive learning rate is perfect for this type of datasets.
06Q&A — What is the idea behind Ensemble Methods?
Most of the errors from a model’s learning are from three main factors: variance, noise, and bias. By using ensemble methods, we’re able to increase the stability of the final model and reduce the errors mentioned previously.Three major kinds of meta-algorithms that aims at combining weak learners:1. Bagging, This is what's called bootstrap aggregating or bagging.It was invented by Bremen in the late '80s, early '90s.Here's how bagging works:So what we do is we create a number of subsets of the data.
I've drawn little bags below to represent bags of data.
And each one of these is a subset of the original data.
Now how do we collect these? Well, we do it randomly with replacement from this original data. We might randomly grab red ball and put it in our bag, but each time we grab randomly, we randomly choose across the whole collection of data. So we might choose red ball again and put it in the bag. So they're repeated twice. And that's okay. That's what with replacement means. Once our collections are formed, we submit each one to training, then we take the mean and bam, we have our predictions (y).Bagging is used to decrease the model’s variance.
2. Boosting In machine learning, boosting is an ensemble meta-algorithm for primarily reducing bias, and also variance.3. StackingStacked Generalization or Stacking for short is an ensemble machine learning algorithm. It involves combining the predictions from multiple machine learning models on the same dataset, like bagging and boosting.
07Q&A —How can you improve the accuracy of the Machine Learning Model?
1 . Add more data;
2 . Treat missing and outlier values;
3 . Feature Engineering;
4 . Feature Selection;
5 . Multiple algorithms;
6 . Algorithm Tuning;
7 . Ensemble methods;
08Q&A —What are Feature Engineering techniques?
In machine learning, features are individual independent variables that act like a input in your system. Actually, while making the predictions, models use such features to make the predictions. And using the feature engineering process, new features can also be obtained from old features in machine learning.Feature engineering is the process of transforming raw data into features that better represent the underlying problem to the predictive models, resulting in improved model accuracy on unseen data. Feature engineering turn your inputs into things the algorithm can understand.The feature engineering process is:. Brainstorming or testing features;. Deciding what features to create;. Creating features;. Checking how the features work with your model;. Improving your features if needed;. Go back to brainstorming/creating more features until the work is done.
09Q&A — What is Feature Selection? What is the best feature selection method?
Feature selection is the process of reducing the number of input variables when developing a predictive model.What is the best feature selection method?. Pearson Correlation: This is a filter-based method;. Chi-Squared: This is another filter-based method;. Recursive Feature Elimination: This is a wrapper based method;. Lasso SelectFromModel;. Tree-based SelectFromModel: This is an Embedded method;Difference between Wrapper versus Filter Melhods:
Wrapper methods measure the usefuness of features based on the classifier performance. In contrast, the Filter Methods pick up the intrinsic properties of the features (ie, relevance of the features) measured via univariate statistics instead of cross-validation performance. Check the table below:
10Q&A — What is a generative algorithm? And discriminative algorithm?
A generative algorithm models how the data was generated in order to categorize a signal. It asks the question: based on my generation assumptions, which category is most likely to generate this signal? A discriminative algorithm does not care about how the data was generated, it simply categorizes a given signal.Generative models can generate new data instances.Discriminative models discriminate between different kinds of data instances.Generative classifiers:1 . naive Bayes classifier and2 . linear discriminant analysisDiscriminative model:1. logistic regression
11Q&A —What is a Convolution in Math?
In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions (f and g) that produces a third function (f*g) that expresses how the shape of one is modified by the other.
12Q&A —What are the 3 key concepts of CNN (Convolutional neural networks)? Can you explain each one succinctly? How does it work?
1 . Local Receptive Fields
2 . Shared Weights and Biases
3 . Activation & Pooling
1. Local Receptive Fields
In a typical neural network, each neuron in the input layer is connected to a neuron in the hidden layer. However, in a CNN, only a small region of input layer neurons connects to neurons in the hidden layer. These regions are referred to as local receptive fields.The local receptive field is translated across an image to create a feature map from the input layer to the hidden layer neurons. You can use convolution to implement this process efficiently. That’s why it is called a convolutional neural network.
2 . Shared Weights and Biases
A typical neural network, a CNN has neurons with weights and biases. The model learns these values during the training process, and it continuously updates them with each new training example. However, in the case of CNNs, the weights and bias values are the same for all hidden neurons in a given layer.
3 . Activation & Pooling
The pooling layer is obtained by applying pooling operator to aggregate information within each small region of the input feature channels and then down sampling the results. Typically, hand-crafted pooling operations are used to aggregate information within a region, but they are not guaranteed to minimize the training error.
13Q&A —How do you reduce high variance in machine learning? What models do recommendations exist?
Logistic Regression
SVM
Neural Network
14Q&A — How do I stop Overfitting?
Use:
. Cross-validation. Cross-validation is a powerful preventative measure against overfitting;
. Train with more data. It won't work every time, but training with more data can help algorithms detect the signal better;
. Remove features;
. Early stopping;
. Regularization;
. Ensembling.
15Q&A — How Do I Choose an Authentication Mode in Huawei Cloud Services?
App authentication (recommended)
API callers will be authenticated using the AppKey and AppSecret issued by API Gateway.IAM authentication (Identity & Access Management)
Token and AK/SK authentication is supported. Token authentication: Requests are authenticated using a token. This authentication mode is recommended because it requires no SDK signatures. AK/SK authentication: Requests are encrypted using an AK(Access key ID)/SK(Secret access key). Request signing is similar to that of App authentication. The AK and SK are used together to identify a request sender to prevent the request from being modified.
IAM authentication does not support API access. APIs with IAM authentication are open to HUAWEI CLOUD tenants. None
APIs with None authentication are open to all public network users.
16Q&A — What is Keras? What is Eager Execution in TensorFlow? Is TensorFlow distributed?
Keras is a high level API of TensorFlow.Tensorflow is not that user-friendly and has a steeper learning curve. To solve that, the high-level Keras API of Tensorflow provides building blocks to create and train deep learning models more easily.Eager Execution is an imperative, define-by-run interface where operations are executed immediately as they are called from Python. This makes it easier to get started with TensorFlow, and can make research and development more intuitiveTensorFlow supports Distributed Computing, allowing portions of the graph to be computed on different processes, which may be on completely different servers! In addition, this can be used to distribute computation to servers with powerful GPUs, and have other computations done on servers with more memory, and so on.
That’s all!
In the next episode more tips.
Study these materials can help you (and myself:) get the Huawei certificate HCIA easily, I hope so!
I will fight for it. I will not give up. I will reach my goal. Absolutely nothing will stop me.
Be my guest!
Credits & References
HCIA-AI V3.0 Mock Exam by
Related Posts
00#Episode — AISeries — ML — Machine Learning Intro — What Is It and How It Evolves Over Time?
01#Episode — AISeries — Huawei ML FAQ — How do I get an HCIA certificate?
02#Episode — AISeries —Huawei ML FAQ Again — More annotation from Huawei Mock Exam (this one:)
03#Episode — AISeries — AI In Graphics — Getting Intuition About Complex Math & More
04#Episode — AISeries — Huawei ML FAQ — Advanced — Even More annotation from Huawei Mock Exam
05#Episode — AISeries — SVM — Credit Card — Start to Finished — A Complete Colab Notebook Using the Default of Credit Card Clients Data Set from UCI
06#Episode — AISeries — SVM — Breast Cancer — Start to Finished — A Complete Colab Notebook Using the Default of Credit Card Clients Data Set from UCI
07#Episode — AISeries — SVM — Cupcakes or Muffins? — Start To Finished — Based on Alice Zhao post
In the era of AI, What Jobs Will Be Replaced by AI?
The Answer is REPETITIVE JOBS that involves LITTLE CREATIVITY and LITTLE SOCIAL INTERACTION ;)
By Huawei
Machine Learning: get your feet wet! Now!
by J3