Class about stochastic optimization

Figures for parabolic costs in 1D:

>> x=-10:.1:10;
>> plot(x,x.^2)
>> close all
>> plot(x,x.^2)
>> plot(x,x.^2+randn(1,length(x)))
>> plot(x,x.^2+randn(1,length(x))*10)
>> hold on
>> plot(x,x.^2,’r’,’LineWidth’,3)
>> set(gca,’FontSize’,15)
>> xlabel(‘x_1′,’FontSize’,15)
>> ylabel(‘Cost’,’FontSize’,15)
>> figure
>> plot(x,5*x.^2+randn(1,length(x))*10)
>> axis([-10 10 0 120])
>> axis([-10 10 0 120])
>> axis auto
>> axis([-10 10 -20 120])
>> hold on
>> plot(x,5*x.^2,’r’,’LineWidth’,3)
>> set(gca,’FontSize’,15)
>> xlabel(‘x_2′,’FontSize’,15)
>> ylabel(‘Cost’,’FontSize’,15)
>> plot(x,5*x.^2+randn(1,length(x))*10)
>> plot(x,5*x.^2+randn(1,length(x))*10)
>> plot(x,5*x.^2+randn(1,length(x))*10)
>> plot(x,5*x.^2+randn(1,length(x))*10)
>> plot(x,5*x.^2+randn(1,length(x))*10)


Figures for the cost of two different neurons:

x=0:.01:1;
>> plot(x,2*x.^2,’b’,’LineWidth’,2)
>> set(gca,’FontSize’,15,’Box’,’off’,’LineWidth’,2)
>> xlabel(‘x_1′,’FontSize’,15)
>> ylabel(‘Cost’,’FontSize’,15)
>> plot(x,2*x.^2,’b’,’LineWidth’,3)
>> set(gca,’FontSize’,15,’Box’,’off’,’LineWidth’,3)
>> xlabel(‘x_1′,’FontSize’,15)
>> ylabel(‘Cost’,’FontSize’,15)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: