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)


Advertisement