add requirements

This commit is contained in:
TerenceLiu98 2022-07-31 01:58:14 +00:00
parent b87b28da17
commit 5f4e45445f
5 changed files with 28 additions and 25 deletions

View File

@ -12,14 +12,14 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "0a5c51d2-8b18-4143-b6f1-73a909ccb623",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "923a9d77eecb4d78ade9e3113cf636c0",
"model_id": "7a9a1093220546d3b7e4cd7606a7c704",
"version_major": 2,
"version_minor": 0
},
@ -33,7 +33,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c2252623a38940f0a80471ec28e491d3",
"model_id": "11824eb29354454eb05a41c4fd7e6539",
"version_major": 2,
"version_minor": 0
},
@ -47,7 +47,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "778d4e34c4ae4b0d8f2f1b4e0d3c1173",
"model_id": "23bd6107b7ea4f8280ab57d100ab4619",
"version_major": 2,
"version_minor": 0
},
@ -65,14 +65,14 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "15c6e757-cde3-422b-be7e-3f55b7752142",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "298df33c058b49e6927e582d532bb87b",
"model_id": "f3cbcf4a398647d787391f02fea55a8e",
"version_major": 2,
"version_minor": 0
},
@ -86,7 +86,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "47315c498b9a46fd9948fd7a53d3e80a",
"model_id": "c12e073565ee4053b890cd4dcded4610",
"version_major": 2,
"version_minor": 0
},
@ -100,7 +100,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0cab52875285496a989f685de24515cb",
"model_id": "3be9b459745d48dd9c367b5a7866c2bc",
"version_major": 2,
"version_minor": 0
},

View File

@ -44,14 +44,7 @@ class gradient_descent_1d(object):
self.params_rvbox = widgets.VBox([self.wg_epsilon, self.wg_max_iter])
self.params_box = widgets.HBox([self.params_lvbox, self.params_rvbox], description="Parameters")
self.button_box = widgets.HBox([self.button_compute, self.button_plot], description="operations")
self.config = widgets.VBox([self.params_box, self.button_box],
layout=widgets.Layout(
display='flex',
flex_flow='column',
border='solid 2px',
align_items='stretch',
width='auto'
))
self.config = widgets.VBox([self.params_box, self.button_box])
self.initialization()
@ -194,6 +187,13 @@ class gradient_descent_2d(object):
buttons=[dict(label="Play",
method="animate",
args=[None])])])
fig.update_layout(
scene = {
"xaxis": {"nticks": 20},
"zaxis": {"nticks": 4},
'camera_eye': {"x": 0, "y": -1, "z": 0.5},
"aspectratio": {"x": 1, "y": 1, "z": 0.2}
})
fig.show()

View File

@ -12,7 +12,7 @@ from tqdm import tqdm
import plotly.graph_objects as go
import plotly.io as pio
pio.renderers.default = 'iframe' # or 'notebook' or 'colab' or 'jupyterlab'
pio.renderers.default = 'notebook' # or 'notebook' or 'colab' or 'jupyterlab'
import warnings
warnings.filterwarnings("ignore")
@ -44,14 +44,7 @@ class gradient_descent_1d(object):
self.params_rvbox = widgets.VBox([self.wg_epsilon, self.wg_max_iter])
self.params_box = widgets.HBox([self.params_lvbox, self.params_rvbox], description="Parameters")
self.button_box = widgets.HBox([self.button_compute, self.button_plot], description="operations")
self.config = widgets.VBox([self.params_box, self.button_box],
layout=widgets.Layout(
display='flex',
flex_flow='column',
border='solid 2px',
align_items='stretch',
width='auto'
))
self.config = widgets.VBox([self.params_box, self.button_box])
self.initialization()
@ -194,6 +187,13 @@ class gradient_descent_2d(object):
buttons=[dict(label="Play",
method="animate",
args=[None])])])
fig.update_layout(
scene = {
"xaxis": {"nticks": 20},
"zaxis": {"nticks": 4},
'camera_eye': {"x": 0, "y": -1, "z": 0.5},
"aspectratio": {"x": 1, "y": 1, "z": 0.2}
})
fig.show()

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
sympy
plotly
ipywidgets