This commit is contained in:
Morten Hjorth-Jensen
2024-09-23 06:10:11 +02:00
parent 195e5b886d
commit 36a8e2cbdf
6 changed files with 293 additions and 288 deletions
+2 -1
View File
@@ -1316,7 +1316,8 @@ desirable properties such as:
<div class="inner_cell">
<div class="input_area">
<div class="highlight" style="background: #eeeedd">
<pre style="font-size: 80%; line-height: 125%;">x = <span style="color: #B452CD">2</span>*np.random.rand(m,<span style="color: #B452CD">1</span>)
<pre style="font-size: 80%; line-height: 125%;">m = <span style="color: #B452CD">100</span>
x = <span style="color: #B452CD">2</span>*np.random.rand(m,<span style="color: #B452CD">1</span>)
y = <span style="color: #B452CD">4</span>+<span style="color: #B452CD">3</span>*x+np.random.randn(m,<span style="color: #B452CD">1</span>)
</pre>
</div>
+2 -1
View File
@@ -1338,7 +1338,8 @@ desirable properties such as:
<div class="inner_cell">
<div class="input_area">
<div class="highlight" style="background: #eeeedd">
<pre style="line-height: 125%;">x = <span style="color: #B452CD">2</span>*np.random.rand(m,<span style="color: #B452CD">1</span>)
<pre style="line-height: 125%;">m = <span style="color: #B452CD">100</span>
x = <span style="color: #B452CD">2</span>*np.random.rand(m,<span style="color: #B452CD">1</span>)
y = <span style="color: #B452CD">4</span>+<span style="color: #B452CD">3</span>*x+np.random.randn(m,<span style="color: #B452CD">1</span>)
</pre>
</div>
+2 -1
View File
@@ -1415,7 +1415,8 @@ desirable properties such as:
<div class="inner_cell">
<div class="input_area">
<div class="highlight" style="background: #f8f8f8">
<pre style="line-height: 125%;">x <span style="color: #666666">=</span> <span style="color: #666666">2*</span>np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>rand(m,<span style="color: #666666">1</span>)
<pre style="line-height: 125%;">m <span style="color: #666666">=</span> <span style="color: #666666">100</span>
x <span style="color: #666666">=</span> <span style="color: #666666">2*</span>np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>rand(m,<span style="color: #666666">1</span>)
y <span style="color: #666666">=</span> <span style="color: #666666">4+3*</span>x<span style="color: #666666">+</span>np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>randn(m,<span style="color: #666666">1</span>)
</pre>
</div>
Binary file not shown.
File diff suppressed because it is too large Load Diff
+1
View File
@@ -815,6 +815,7 @@ o The cost function is convex which guarantees that gradient descent converges f
We revisit an example similar to what we had in the first homework set. We had a function of the type
!bc pycod
m = 100
x = 2*np.random.rand(m,1)
y = 4+3*x+np.random.randn(m,1)
!ec