User talk: Admin: Difference between revisions

From ElixirBlocks
Jump to: navigation, search
No edit summary
No edit summary
Line 1: Line 1:
=Tensorflow.js Notes=
=Tensorflow.js Notes=
*There are two categories of data.
**  Training data
**  Test data


Training a model in TensorFlow.js is done by calling the model’s fit() method. We fit
Training a model in TensorFlow.js is done by calling the model’s fit() method. We fit

Revision as of 15:35, 5 January 2024

Tensorflow.js Notes

  • There are two categories of data.
    • Training data
    • Test data



Training a model in TensorFlow.js is done by calling the model’s fit() method. We fit the model to the training data

(async function() {
 await model.fit(trainTensors.sizeMB,
 trainTensors.timeSec,
 {epochs: 10});
})();


What is the role of a Developer in ML?

With normal code, a human writes the code directly, and a computer reads and inter‐ prets that code, or some derivative of it.

In Machine Learning, a human writes the algorithm’s trainer. Assisted by a frame‐ work, or even from scratch, a human outlines in code the parameters of the problem, the desired structure, and the location of the data to learn from. Now the machine runs this program-training program, which continuously writes an ever-improving algorithm as the solution to that problem. At some point, you stop this program and take the latest algorithm result out and use it.

The algorithm is much smaller than the data that was used to create it.

The resulting algorithm is essentially a collection of numbers that balance the out‐ lined structure identified by the human programmer. The collection of numbers and their associated neural graph is often called a model.

Tensor

A tensor is a fancy word that means "multi dimensional array". Imagine a tensor as a kind of fluid that carries data. In TensorFlow, it flows through a graph—a data structure consisting of interconnected mathematical operations (called nodes). As figure 1.7 shows, the node can be successive layers in a neural network. Each node takes tensors as inputs and produces tensors as outputs. The “tensor fluid” gets transformed into different shapes and different values as it “flows” through the TensorFlow graph. This corresponds to the transformation of representations: that is, the crux of what neural networks do, as we have described in previous sections


Role of Tensorflow.js?

TensorFlow.js handles the API for specifying the structure or archi‐ tecture of the model, loading data, passing data through our machine learning pro‐ cess, and ultimately tuning the machine to be better at predicting answers to the given input the next time. This is where the real benefits of TensorFlow.js come to bear. All we have to worry about is properly tuning the framework to solve the prob‐ lem with sufficient data and then saving the resulting model.

Types of Machine Learning

Supervised

Most common form of learning. Supervised ML simply means that we have an answer key for every question we’re using to train our machine. That is to say, our data is labeled. So if we’re trying to teach a machine to distinguish if a photo contains a bird, we can immediately grade the AI on whether it was right or wrong. Like a Scantron, we have the answer key. But unlike a Scantron and because it’s probability math, we can also identify how wrong the answer was.

Unsupervised

Unsupervised learning doesn’t require us to have an answer key. We only need ques‐ tions. Unsupervised machine learning would be ideal, as most information in the world does not come with labels. This category of machine learning focuses on what a machine could learn and report from unlabeled data.

Semisupervised

Semi-supervised learning is a broad category of machine learning that uses labeled data to ground predictions, and unlabeled data to learn the shape of the larger data distribution. Practitioners can achieve strong results with fractions of the labeled data, and as a result, can save valuable time and money.

Reinforcement

Reinforcement learning (RL) is a machine learning (ML) technique that trains software to make decisions to achieve the most optimal results. It mimics the trial-and-error learning process that humans use to achieve their goals.