Created
April 21, 2020 16:35
-
-
Save Mehdi-Amine/79d86b87aebf4df2419321140914634c to your computer and use it in GitHub Desktop.
investigating the effect of feature scaling on SGD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.graph_objects as go | |
fig = go.Figure() | |
fig.add_trace(go.Scatter3d(x = params[:, 0], y = params[:, 1], z = params[:, 2], | |
mode='lines', | |
name='No Scaling', | |
line=dict(color='green', width=2))) | |
fig.add_trace(go.Scatter3d(x = params_std[:, 0], y = params_std[:, 1], z = params_std[:, 2], | |
mode='lines', | |
name='Standardization', | |
line=dict(color='blue', width=2))) | |
fig.add_trace(go.Scatter3d(x = params_normd[:, 0], y = params_normd[:, 1], z = params_normd[:, 2], | |
mode='lines', | |
name='Normalization', | |
line=dict(color='red', width=2))) | |
fig.update_layout(title = "<b>Comparing the effect of feature scaling on SGD</b>", | |
scene = dict(xaxis_title = 'Bias', yaxis_title = 'Weight 1', zaxis_title = 'Weight 2'), | |
scene_camera = dict(eye=dict(x=1.5, y=1.5, z=0.1)), | |
#margin=dict(l=0, r=0, b=0, t=0), | |
legend=dict(x = -.1), | |
legend_orientation = "v", | |
legend_title = '<b> Parameter convergence with </b>', | |
) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment