Platform
Resources
Pricing
Sign in
Get started
Ross Stewart
Workspace
Fork
Published
By
Ross Stewart
Edited
Nov 9, 2021
Fork of
The Gradient descent with Sine Wave
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fpartialX
=
(
x
,
y
)
=>
x
*
Math
.
cos
(
Math
.
sqrt
(
x
*
x
+
y
*
y
)
)
/
Math
.
sqrt
(
x
*
x
+
y
*
y
)
Insert cell
fpartialY
=
(
x
,
y
)
=>
y
*
Math
.
cos
(
Math
.
sqrt
(
x
*
x
+
y
*
y
)
)
/
Math
.
sqrt
(
x
*
x
+
y
*
y
)
Insert cell
Insert cell
position
=
{
const
position
=
[
]
let
x
=
x0
let
y
=
y0
for
(
let
i
=
0
;
i
<=
1000
;
i
=
i
+
1
)
{
position
.
push
(
[
x
,
y
]
)
x
=
x
-
.01
*
fpartialX
(
x
,
y
)
y
=
y
-
.01
*
fpartialY
(
x
,
y
)
}
return
position
}
Insert cell
x
=
position
[
step
]
[
0
]
Insert cell
y
=
position
[
step
]
[
1
]
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
x0
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
y0
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
step
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
f
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
fpartialX
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
fpartialY
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
grid
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
position
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
x
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
y
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML