A Practical Guide to Machine Learning with TensorFlow 2.0 & Keras Jupyter Notebook Setup
Transcript from the "Jupyter Notebook Setup" Lesson
>> So I've demonstrated and talked a little bit about the quite complex concept. Let's dial down a little bit and start with the linear regression. So I want to just show you how programmatically those weights and biases can be calculated, or how we can figure them out. So, what I will do, I will probably just start the new notebook, and we'll demonstrate everything from scratch.
[00:00:38] So finally, we can switch into Python programming. And right from the beginning, I don't need TensorFlow from this, but I will still use it. I want to show you a couple of interesting functions in TensorFlow which can be used even for this simple problem. But at the same time I will not try to use built in functionality of TensorFlow to fit, I will try to do it manually.
[00:01:05] But then in the next exercise, we'll transition to those helper functions. So let's imports, by the way, in Jupyter Notebooks, pressing Tab is pretty useful command because it will simply autocomplete or show you the available options. So for instance if I type TensorFlow and then press Tab it will show me all the available modules currently installed and available on my machine.
[00:02:04] So, actually let me turn off header and toolbar back again. So now it means that functionality of TensorFlow is available for me and I can just type something like if I execute it. So by executing, I just press Shift + Enter, right? And it execute the current cell and open the new one for me.
[00:02:30] Now I can type tf dot and just look at all the available methods, functions, constants, basically everything what's available in TensorFlow. Pretty useful functionality of Jupyter Notebooks is also to type question mark after any command or function. And if you execute the cell, it will actually bring you the additional window with the information about this command or this function.
[00:03:00] Well TensorFlow root package, right, it doesn't really give you any useful information. Let's try something else like TensorFlow, for instance random. That's another module, but if we execute it, a public API for tf.random namespace, yeah. Also not useful, random, let's say we have uniform, yes, uniform distribution. So this function is actually generates random values with a uniform distribution in the range between 0 and 1.
[00:03:43] So for instance, if I now just run this function, I actually got an error, missing one required positional argument shape. Aha, so actually if I would have continue reading the help, it would say that yes shape is required, also I can provide additional parameters to my function call and shape is just the 1-D integer tenser.
[00:04:14] And tensor is just the array or matrix, right? So the shape of the output tensor and actually, yeah, I don't see any examples here. But for instance, I can provide something like this one, that's our tesnsor. And jut because I'm using TensorFlow, it will return, the result will be in tenser, it will be shaped 1, just as I specified.
[00:04:41] And the number is just this random number between 0 and 1. So now if I just do print for instance, The values change just because this function was called once again. If you're getting anything for instance, let's see our variable is cold var and we will just assign something to it.
[00:05:13] We can print and it's gonna lose all the information about the tensor if we just do var numpy. And now I have to explain kind of what is TensorFlow, what is numpy, and how they relate to each other. But basically this command will transform any tensor representation to NumPy representation and NumPy, or numeric package is the.
[00:05:46] Just the way the classical representation how the data is stored, so it's just gonna be your fault number.