Manually train a linear function he (x) = 0x based on the following aining instances using stochastic gradient descent algorithm. The initial values of arameters are 0 = 0.1,0₁ = 0.1, 0₂ = 0.1. The learning rate a is 0.1. Please pdate each parameter at least five times. 0 0 1 1 x₂ 0 1 0 1 y 2334

College Physics
11th Edition
ISBN:9781305952300
Author:Raymond A. Serway, Chris Vuille
Publisher:Raymond A. Serway, Chris Vuille
Chapter1: Units, Trigonometry. And Vectors
Section: Chapter Questions
Problem 1CQ: Estimate the order of magnitude of the length, in meters, of each of the following; (a) a mouse, (b)...
icon
Related questions
Question
Manually train a linear function \( h_\theta(\mathbf{x}) = \boldsymbol{\theta}^T \cdot \mathbf{x} \) based on the following training instances using the stochastic gradient descent algorithm. The initial values of parameters are \( \theta_0 = 0.1 \), \( \theta_1 = 0.1 \), \( \theta_2 = 0.1 \). The learning rate \( \alpha \) is 0.1. Please update each parameter at least five times.

The table of training instances is as follows:

\[
\begin{array}{ccc}
x_1 & x_2 & y \\
\hline
0 & 0 & 2 \\
0 & 1 & 3 \\
1 & 0 & 3 \\
1 & 1 & 4 \\
\end{array}
\]
Transcribed Image Text:Manually train a linear function \( h_\theta(\mathbf{x}) = \boldsymbol{\theta}^T \cdot \mathbf{x} \) based on the following training instances using the stochastic gradient descent algorithm. The initial values of parameters are \( \theta_0 = 0.1 \), \( \theta_1 = 0.1 \), \( \theta_2 = 0.1 \). The learning rate \( \alpha \) is 0.1. Please update each parameter at least five times. The table of training instances is as follows: \[ \begin{array}{ccc} x_1 & x_2 & y \\ \hline 0 & 0 & 2 \\ 0 & 1 & 3 \\ 1 & 0 & 3 \\ 1 & 1 & 4 \\ \end{array} \]
Expert Solution
Step 1 The answer provided below has been developed in a clear step by step manner;

First of all we have to write Gradient Descent algorithm. Here I'm choosing python language because there is no given language in your query.

Gradient Descent algorithm:- #1. Import All Libraries import mumpy as np import pandas as pd from sklearn. linear_model import Linear Regression import math.

#2. Train Model Using Sklearn def predict_using_sklean(): df = pd.read_csv("test.csv") r = LinearRegression() r.fit(df[['x1','x2']],df.y) print(r.intercept_) return r.coef_, r.intercept_ predict_using_sklean() #Output:
 
2.0
Out [37] (array([1., 1.]), 2.0)

 

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Equation of waves
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, physics and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
College Physics
College Physics
Physics
ISBN:
9781305952300
Author:
Raymond A. Serway, Chris Vuille
Publisher:
Cengage Learning
University Physics (14th Edition)
University Physics (14th Edition)
Physics
ISBN:
9780133969290
Author:
Hugh D. Young, Roger A. Freedman
Publisher:
PEARSON
Introduction To Quantum Mechanics
Introduction To Quantum Mechanics
Physics
ISBN:
9781107189638
Author:
Griffiths, David J., Schroeter, Darrell F.
Publisher:
Cambridge University Press
Physics for Scientists and Engineers
Physics for Scientists and Engineers
Physics
ISBN:
9781337553278
Author:
Raymond A. Serway, John W. Jewett
Publisher:
Cengage Learning
Lecture- Tutorials for Introductory Astronomy
Lecture- Tutorials for Introductory Astronomy
Physics
ISBN:
9780321820464
Author:
Edward E. Prather, Tim P. Slater, Jeff P. Adams, Gina Brissenden
Publisher:
Addison-Wesley
College Physics: A Strategic Approach (4th Editio…
College Physics: A Strategic Approach (4th Editio…
Physics
ISBN:
9780134609034
Author:
Randall D. Knight (Professor Emeritus), Brian Jones, Stuart Field
Publisher:
PEARSON