# Libraries used in C2\_W1\_Lab01\_Neurons\_and\_Layers

**URL:** <https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069>\
**Category:** Advanced Learning Algorithms\
**Tags:** week-module-1\
**Created:** [September 26, 2023, 10:29pm UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069 "2023-09-26T22:29:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitesh\_Varma](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@Nitesh\_Varma](https://community.deeplearning.ai/u/Nitesh_Varma)\
**Post date:** [September 26, 2023, 10:29pm UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/1 "2023-09-26T22:29:02Z")

</div>

Hi,

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

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

```

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [September 26, 2023, 11:03pm UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/2 "2023-09-26T23:03:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christina\_Fan](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@Christina\_Fan](https://community.deeplearning.ai/u/Christina_Fan)\
**Post date:** [February 9, 2024, 12:26am UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/3 "2024-02-09T00:26:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [February 9, 2024, 12:43am UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/4 "2024-02-09T00:43:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [February 9, 2024, 12:45am UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/5 "2024-02-09T00:45:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Christina\_Fan](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@Christina\_Fan](https://community.deeplearning.ai/u/Christina_Fan)\
**Post date:** [February 10, 2024, 12:24am UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/6 "2024-02-10T00:24:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Christina\_Fan](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@Christina\_Fan](https://community.deeplearning.ai/u/Christina_Fan)\
**Post date:** [February 10, 2024, 12:42am UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/7 "2024-02-10T00:42:18Z")

</div>

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?

 ![image](https://global.discourse-cdn.com/dlai/original/3X/8/d/8d9d2bccde7c1485c4821d9f14c70ec97a05a62d.png)

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [February 10, 2024, 12:45am UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/8 "2024-02-10T00:45:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Christina\_Fan](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@Christina\_Fan](https://community.deeplearning.ai/u/Christina_Fan)\
**Post date:** [February 10, 2024, 12:55am UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/9 "2024-02-10T00:55:29Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [February 10, 2024, 1:13am UTC](https://community.deeplearning.ai/t/libraries-used-in-c2-w1-lab01-neurons-and-layers/456069/10 "2024-02-10T01:13:52Z")

</div>

> [@Christina\_Fan](#):
>
> is this referring to f(x) I meant equivalent to the linear regression model output f(x)

Yes.

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