Swift for TensorFlow - The Next Generation platform for Deep Learning.
Aprenderás a entrenar un modelo de Deep Learning utilizando Swift para TensorFlow, la nueva plataforma que Google está construyendo para Deep Learning; sus ventajas y cómo es que te permite crear algoritmos de una forma más sencilla y rápida.
is that we'll have trained an image classifier which can recognize pet breeds at state of the art accuracy. The key to this success is the use of transfer learning, which will be a key platform for much of this course. We also discuss how to set the most important hyper-parameter when training neural networks: the learning rate, using Leslie Smith's fantastic learning rate finder method. Finally, we'll look at the important but rarely discussed topic of labeling, and learn about some of the features that fastai provides for allowing you to easily add labels to your images. https://course.fast.ai/videos/?lesson=1
support for parallel processing, but very easy to use. 14 Hard to use (and C++ is slow at compile time), but fast and (for C++) expressive. Unsafe (unless you use Typescript); somewhat slow (but easy to use and flexible) Poor support for general purpose programming, but fast and expressive. Verbose (but getting better, particularly if you use Kotlin), less flexible (due to JVM issues). Requires installation of a runtime, limited flexibility due to garbage collection, slow https://www.fast.ai/2019/01/10/swift-numerics/
support in a general-purpose programming language. Next-generation APIs New APIs informed by the best practices of today, and the research directions of tomorrow, are both easier to use and more powerful. Builds on TensorFlow Building on TensorFlow, the Swift APIs give you transparent access to all low-level TensorFlow operators.
the organization and integration of data collected from various sources. 25 Techniques You can use techniques like Questionnaires and surveys, conducting interviews, using data scraping and data crawling techniques.
database of handwritten digits that is commonly used for training and testing in the field of machine learning. https://en.wikipedia.org/wiki/MNIST_database 27
recognize various classes of images. 37 When we subsequently provide a new image as input to the model, it will output the probabilities of the image representing each of the types it was trained on.
0 0.00 1 0.02 ... 0.00 7 0.97 8 0.00 9 0.01 38 Based on the output, we can see that the classification model has predicted that the image has a high probability of representing a number 7
basing your personal decisions all day long, most of the time without even recognizing the process consciously https://mitsloan.mit.edu/ideas-made-to-matter/how-to-use -algorithms-to-solve-everyday-problems 43
algorithms Second Order Optimization Algorithms • Hessian https://towardsdatascience.com/types-of-optimization-algorithms-used-in-neural-networks-and- ways-to-optimize-gradient-95ae5d39529f 44
many optimization algorithms available for training. This model uses the SGD optimizer that implements the stochastic gradient descent (SGD) algorithm. 46 // Using Gradient Descent as the optimizer let optimizer = SGD(for: classifier, learningRate: 0.1)
supports many additional optimizers. You can choose your pick based on your project: 47 ‐ AMSGrad ‐ AdaDelta ‐ AdaGrad ‐ AdaMax ‐ Adam ‐ Parameter ‐ RMSProp ‐ SGD
Error/L1 Loss Regression losses: • Hinge Loss/Multi-class SVM Loss • Cross Entropy • Loss/Negative Log Likelihood LOSS FUNCTIONS To know which model is good for our data, we compute the loss function by comparing the predicted outputs to actual output. 49
using the softmaxCrossEntropy(logits:labels:) function which takes the model's class probability predictions and the desired label, and returns the average loss across the examples. 51 let loss = softmaxCrossEntropy(logits: ŷ, labels: y)
Int = 0 var totalGuessCount: Int = 0 var totalLoss: Float = 0 } // The training loop - DATA for epoch in 1...epochCount { var trainStats = Statistics() } let trainAccuracy = Float(trainStats.correctGuessCount) / Float(trainStats.totalGuessCount) let testAccuracy = Float(testStats.correctGuessCount) / Float(testStats.totalGuessCount) print(""" [Epoch \(epoch)] \ Training Loss: \(trainStats.totalLoss), \ Training Accuracy: \(trainStats.correctGuessCount)/\(trainStats.totalGuessCount) \ (\(trainAccuracy)), \ Test Loss: \(testStats.totalLoss), \ Test Accuracy: \(testStats.correctGuessCount)/\(testStats.totalGuessCount) \ (\(testAccuracy)) """) }
Fast AI • Practical Deep Learning for Coders: ◦ https://course.fast.ai/ ◦ https://course.fast.ai/part2. Swift and tensorflow - Colaboration with Chris Lattner • Embracing Swift for Deep Learning ◦ https://www.fast.ai/2019/03/06/fastai-swift/ 66 IF YOU DON’T FEEL READY….
Intro to Machine Learning: ◦ https://www.udacity.com/course/intro-to-machine-learn ing--ud120 • TensorFlow for Deep Learning ◦ https://www.udacity.com/course/intro-to-tensorflow-for -deep-learning--ud187 ◦ 67 Learning about ai, ml and deep learning
walkthrough ◦ https://www.tensorflow.org/swift/tutorials/model_traini ng_walkthrough • Guide to learn swift from scratch for Data Science ◦ https://www.analyticsvidhya.com/blog/2019/10/compre hensive-guide-learn-swift-from-scratch-data-science/ • Swift for Machine learning (podcast episode) ◦ https://www.swiftbysundell.com/podcast/58/ ◦ 68 Swift for tensorflow