Libraries used in C2_W1_Lab01_Neurons_and_Layers

Hi,

I’m looking at the Lab01 - Neurons and Layers and it has the following libraries imported. Where can I find these?

from lab_utils_common import dlc
from lab_neurons_utils import plt_prob_1d, sigmoidnp, plt_linear, plt_logistic

Open the notebook’s Files menu. The python files are there.

Hi mentor
I am not quite sure what we are supposed to get out from the Lab01 - Neurons and Layers? What are the learning points by going through the Lab 01 practice?
Sorry this is first time I learnt this new tool of tensorflow and keras. What tensorflow and keras can be used for?
does it mean neuron network can apply to both linear and logistic regression?
where i can get the file tensorflow.keras.layers?

Many thanks
Christina

TensorFlow is a machine learning software package that makes it easy to create machine learning models. You only have to specify the architecture of the network (the number of layers and the number of units per layer). The model automatically knows how to train the network you have designed, so you don’t have to worry about writing code for backpropagation, training, cost functions, etc.

It’s basically a machine learning toolbox.

Keras is a front-end interface for TensorFlow that makes it easier to write the code. Native TensorFlow is a little complicated - Keras makes it simpler.

You still have to design the network, and decide whether to use linear regression or logistic regression. That’s part of the design for the problem you’re trying to solve.

Thank you so much TMosh, very helpful as always. What you were saying is that TensorFlow is another ML model in solving linear and classifications problems, am I right?
If so, the ability of using right model in solving a specific problem comes down practice, experience or there are hard rules when approaching certain problem?

Additionally, a question regarding the tensorFlow model in the lab, the output [0.77] from the cell 6, is this referring to f(x) I meant equivalent to the linear regression model output f(x)? I am trying to understand how TS works in the process?

TensorFlow isn’t a “model”, it’s a toolset that helps you create models.

Yes, experience and skill are always required.

There are a few hard rules:

  • If you’re predicting a real value, use a linear output layer.
  • If you’re predicting classifications, use a sigmoid or softmax() output layer (or a linear output with “from_logits = True”, which gives the same results but is more efficient for TensorFlow).

These are covered in the MLS course, and covered more heavily in the DLS course.

so we actually use TensorFlow to build a model and we define the model by defining a specific activation function (eg linear or sigmoid) based on the problem we try to solve. is my understanding correctly?

Yes.

It’s the equivalent of computing f_wb = (w*x + b). But TensorFlow handles it all for you.