# Neural network - Can individual neurons select between logistic regression vs linear regression

**URL:** <https://community.deeplearning.ai/t/neural-network-can-individual-neurons-select-between-logistic-regression-vs-linear-regression/568540>\
**Category:** Advanced Learning Algorithms\
**Tags:** week-module-1\
**Created:** [February 9, 2024, 6:26pm UTC](https://community.deeplearning.ai/t/neural-network-can-individual-neurons-select-between-logistic-regression-vs-linear-regression/568540 "2024-02-09T18:26:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![santosh.pothula](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@santosh.pothula](https://community.deeplearning.ai/u/santosh.pothula)\
**Post date:** [February 9, 2024, 6:26pm UTC](https://community.deeplearning.ai/t/neural-network-can-individual-neurons-select-between-logistic-regression-vs-linear-regression/568540/1 "2024-02-09T18:26:33Z")

</div>

In the Demand Prediction topic, it was mentioned that each neuron is doing a logistic regression computation. That output is passed onto the neuron in the next layer.

Can some neurons do linear regression and others logistic regression? Are there such use cases?

> **[Demand Prediction - Neural Networks | Coursera](https://www.coursera.org/lecture/advanced-learning-algorithms/demand-prediction-MsbrF)**
>
> Video created by DeepLearning.AI, Stanford University for the course "Advanced Learning Algorithms". This week, you'll learn about neural networks and how to use them for classification tasks. You'll use the TensorFlow framework to build a ...

---

<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, 8:04pm UTC](https://community.deeplearning.ai/t/neural-network-can-individual-neurons-select-between-logistic-regression-vs-linear-regression/568540/2 "2024-02-09T20:04:27Z")

</div>

How the neurons act is controlled by the cost function.

If you’re using a logistic cost function, then all of the neurons in the output layer will have their weights updated as appropriate for logistic regression.

You can specify different activations for each hidden layer. This is actually very common. But the whole layer would typically have the same activation.

You could have a compound deep learning network where you could split a layer into two portions, and have different activation functions for each part. But you’d need a very good reason for using that type of complexity.
