Code Monkey home page Code Monkey logo

ml-task's Introduction

Task 1

Problem Statement

Create a streamlit app which has various controls like number of neurons in each layer, lr, epochs etc. and shows the fit on various datasets. It should show the probabilities on the contour plot and not the discrete predictions.
Have an option of including various transformations to the inputs (basis functions): sine basis. Gaussian basis. Polynomial basis and show the effect of each on the fit via the same contour plots.
Refer to: https://jakevdp.github.io/PythonDataScienceHandbook/05.06-linear-regression.html
Find out what is MC dropout method for getting uncertainty. Add an option to enable it in your demo.

Solution

Streamlit App

Use command below to run the app

streamlit run app.py

On the left side of the app, there are various controls like number of neurons in each layer, lr, epochs etc. and shows the fit on various datasets.

After selecting your desired parameter values, click on the Train Model button to see the results. (Wait for the model to train it takes a bit of time). The app will show the probabilities on the contour plot.

Alt text

If you apply MC Dropout which adds dropout to the neural network during prediction, you can see the uncertainty in the predictions.
This prevents overfitting and gives a better estimate of the uncertainty in the predictions.

Alt text

Dropout in Neural Networks:

Dropout is a regularization technique commonly used in neural networks to prevent overfitting and improve generalization. During training, dropout randomly deactivates a certain percentage of neurons in a layer, effectively creating a smaller and less complex network. This dropout process introduces redundancy and encourages neurons to be more robust and less dependent on specific inputs or connections. By applying dropout during training, the network learns to be more resilient and less sensitive to noise or outliers in the data. During inference or testing, dropout is turned off, and the full network is used for making predictions. Dropout has been shown to be effective in reducing overfitting, leading to better generalization and improved performance on unseen data.

MC Dropout (Monte Carlo Dropout) in Neural Networks:

MC Dropout is an extension of the dropout technique that offers a way to estimate uncertainty in the predictions made by a neural network. In standard dropout, dropout masks are applied only during training, and dropout is disabled during testing, resulting in deterministic predictions. However, in MC Dropout, dropout is maintained during testing as well. By making multiple forward passes through the network with different dropout masks, MC Dropout allows us to obtain a distribution of predictions rather than a single point estimate. The variance in the predictions reflects the model's uncertainty about its output. MC Dropout can be particularly useful in scenarios where uncertainty estimation is crucial, such as in safety-critical applications or when dealing with limited data. It provides valuable insights into the model's confidence levels and aids in making more informed decisions based on prediction uncertainty.

ml-task's People

Contributors

lipika-rajpal avatar kanishk-py avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.