In [84]:
require 'nn';
require 'csvigo';

In [85]:
-- reload the array
data = torch.Tensor{ csvigo.load{path='ex1data1.txt', mode='raw'} }


Out[85]:
<csv>	parsing file: ex1data1.txt	
<csv>	parsing done	

In [86]:
data

In [87]:
trainset = {}
trainset.data = data[1][{{},{1}}]
trainset.label = data[1][{{},{2}}]

In [88]:
trainset

In [89]:
print(#trainset.data)

In [90]:
setmetatable(trainset,
    {__index = function(t,i)
                return {t.data[i], t.label[i]}
            end}
);
function trainset:size()
    return self.data:size(1)
end

In [91]:
print(trainset:size())

In [92]:
print(trainset[33])


Out[92]:
{
  1 : DoubleTensor - size: 1
  2 : DoubleTensor - size: 1
}

2. define neural network


In [93]:
net = nn.Sequential()
net:add(nn.Linear(1, 1))

3. define loss function


In [94]:
criterion = nn.MSECriterion()

4. train the neural network


In [95]:
trainer = nn.StochasticGradient(net, criterion)
trainer.learningRate = 0.001
trainer.maxIteration = 100

In [96]:
trainer:train(trainset)


Out[96]:
# StochasticGradient: training	
Out[96]:
# current error = 12.832555698794	
Out[96]:
# current error = 12.808382691402	
Out[96]:
# current error = 12.566188725637	
Out[96]:
# current error = 12.340273758417	
Out[96]:
# current error = 12.129564040363	
Out[96]:
# current error = 11.933055997524	
Out[96]:
# current error = 11.749811665984	
Out[96]:
# current error = 11.578954422782	
Out[96]:
# current error = 11.419664993956	
Out[96]:
# current error = 11.271177721736	
Out[96]:
# current error = 11.13277707408	
Out[96]:
# current error = 11.003794380848	
Out[96]:
# current error = 10.883604781915	
Out[96]:
# current error = 10.771624373471	
Out[96]:
# current error = 10.667307539675	
Out[96]:
# current error = 10.570144457621	
Out[96]:
# current error = 10.479658764387	
Out[96]:
# current error = 10.395405375659	
Out[96]:
# current error = 10.316968446082	
Out[96]:
# current error = 10.243959462166	
Out[96]:
# current error = 10.176015459127	
Out[96]:
# current error = 10.112797353641	
Out[96]:
# current error = 10.053988384975	
Out[96]:
# current error = 9.9992926574785	
Out[96]:
# current error = 9.9484337778426	
Out[96]:
# current error = 9.9011535809926	
Out[96]:
# current error = 9.8572109388499	
Out[96]:
# current error = 9.8163806465918	
Out[96]:
# current error = 9.7784523813761	
Out[96]:
# current error = 9.7432297288282	
Out[96]:
# current error = 9.7105292728909	
Out[96]:
# current error = 9.6801797449237	
Out[96]:
# current error = 9.6520212282038	
Out[96]:
# current error = 9.6259044142334	
Out[96]:
# current error = 9.6016899074858	
Out[96]:
# current error = 9.5792475754477	
Out[96]:
# current error = 9.5584559410128	
Out[96]:
# current error = 9.5392016144779	
Out[96]:
# current error = 9.5213787625663	
Out[96]:
# current error = 9.5048886120747	
Out[96]:
# current error = 9.4896389858928	
Out[96]:
# current error = 9.4755438692912	
Out[96]:
# current error = 9.4625230045114	
Out[96]:
# current error = 9.4505015118171	
Out[96]:
# current error = 9.4394095352871	
Out[96]:
# current error = 9.4291819117404	
Out[96]:
# current error = 9.4197578612892	
Out[96]:
# current error = 9.4110806981144	
Out[96]:
# current error = 9.4030975601456	
Out[96]:
# current error = 9.3957591564177	
Out[96]:
# current error = 9.3890195309532	
Out[96]:
# current error = 9.382835842094	
Out[96]:
# current error = 9.3771681562783	
Out[96]:
# current error = 9.3719792553205	
Out[96]:
# current error = 9.3672344563162	
Out[96]:
# current error = 9.3629014433495	
Out[96]:
# current error = 9.3589501102331	
Out[96]:
# current error = 9.3553524135635	
Out[96]:
# current error = 9.3520822354179	
Out[96]:
# current error = 9.3491152550653	
Out[96]:
# current error = 9.3464288291031	
Out[96]:
# current error = 9.3440018794704	
Out[96]:
# current error = 9.3418147888238	
Out[96]:
# current error = 9.3398493027957	
Out[96]:
# current error = 9.3380884386849	
Out[96]:
# current error = 9.3365164001615	
Out[96]:
# current error = 9.3351184975908	
Out[96]:
# current error = 9.3338810736114	
Out[96]:
# current error = 9.3327914336226	
Out[96]:
# current error = 9.3318377808617	
Out[96]:
# current error = 9.3310091557691	
Out[96]:
# current error = 9.3302953793633	
Out[96]:
# current error = 9.3296870003604	
Out[96]:
# current error = 9.3291752457966	
Out[96]:
# current error = 9.3287519749204	
Out[96]:
# current error = 9.3284096361437	
Out[96]:
# current error = 9.3281412268499	
Out[96]:
# current error = 9.3279402558706	
Out[96]:
# current error = 9.3278007084589	
Out[96]:
# current error = 9.3277170135919	
Out[96]:
# current error = 9.3276840134527	
Out[96]:
# current error = 9.3276969349461	
Out[96]:
# current error = 9.3277513631171	
Out[96]:
# current error = 9.3278432163438	
Out[96]:
# current error = 9.3279687231917	
Out[96]:
# current error = 9.3281244008168	
Out[96]:
# current error = 9.3283070348175	
Out[96]:
# current error = 9.3285136604392	
Out[96]:
# current error = 9.3287415450428	
Out[96]:
# current error = 9.3289881717524	
Out[96]:
# current error = 9.3292512242066	
Out[96]:
# current error = 9.3295285723385	
Out[96]:
# current error = 9.3298182591175	
Out[96]:
# current error = 9.3301184881886	
Out[96]:
# current error = 9.3304276123509	
Out[96]:
# current error = 9.3307441228177	
Out[96]:
# current error = 9.3310666392093	
Out[96]:
# current error = 9.3313939002265	
Out[96]:
# current error = 9.3317247549627	
Out[96]:
# current error = 9.3320581548098	
Out[96]:
# current error = 9.3323931459197	
Out[96]:
# current error = 9.3327288621844	
Out[96]:
# current error = 9.3330645186991	
Out[96]:
# current error = 9.3333994056772	
Out[96]:
# current error = 9.3337328827863	
Out[96]:
# current error = 9.3340643738776	
Out[96]:
# current error = 9.3343933620817	
Out[96]:
# current error = 9.3347193852468	
Out[96]:
# current error = 9.335042031696	
Out[96]:
# current error = 9.3353609362826	
Out[96]:
# current error = 9.3356757767225	
Out[96]:
# current error = 9.3359862701864	
Out[96]:
# current error = 9.3362921701331	
Out[96]:
# current error = 9.3365932633678	
Out[96]:
# current error = 9.3368893673108	
Out[96]:
# current error = 9.3371803274616	
Out[96]:
# current error = 9.3374660150456	
Out[96]:
# current error = 9.3377463248305	
Out[96]:

Out[96]:
# current error = 9.3380211731017	
Out[96]:
# current error = 9.3382904957845	
Out[96]:
# current error = 9.3385542467046	
Out[96]:
# current error = 9.3388123959762	
Out[96]:
# current error = 9.3390649285095	
Out[96]:
# current error = 9.3393118426291	
Out[96]:
# current error = 9.339553148796	
Out[96]:
# current error = 9.3397888684261	
Out[96]:
# current error = 9.3400190327972	
Out[96]:
# current error = 9.340243682041	
Out[96]:
# current error = 9.3404628642107	
Out[96]:
# current error = 9.3406766344226	
Out[96]:
# current error = 9.3408850540631	
Out[96]:
# current error = 9.3410881900594	
Out[96]:
# current error = 9.341286114207	
Out[96]:
# current error = 9.3414789025516	
Out[96]:
# current error = 9.3416666348211	
Out[96]:
# current error = 9.3418493939039	
Out[96]:
# current error = 9.34202726537	
Out[96]:
# current error = 9.3422003370325	
Out[96]:
# current error = 9.3423686985462	
Out[96]:
# current error = 9.3425324410404	
Out[96]:
# current error = 9.3426916567839	
Out[96]:
# current error = 9.3428464388793	
Out[96]:
# current error = 9.3429968809849	
Out[96]:
# current error = 9.3431430770622	
Out[96]:
# current error = 9.3432851211463	
Out[96]:
# current error = 9.3434231071386	
Out[96]:
# current error = 9.3435571286195	
Out[96]:
# current error = 9.3436872786793	
Out[96]:
# current error = 9.3438136497668	
Out[96]:
# current error = 9.3439363335537	
Out[96]:
# current error = 9.344055420813	
Out[96]:
# current error = 9.3441710013117	
Out[96]:
# current error = 9.3442831637153	
Out[96]:
# current error = 9.3443919955045	
Out[96]:
# current error = 9.3444975829013	
Out[96]:
# current error = 9.3446000108061	
Out[96]:
# current error = 9.3446993627423	
Out[96]:
# current error = 9.3447957208104	
Out[96]:
# current error = 9.3448891656489	
Out[96]:
# current error = 9.3449797764015	
Out[96]:
# current error = 9.345067630692	
Out[96]:
# current error = 9.3451528046036	
Out[96]:
# current error = 9.3452353726638	
Out[96]:
# current error = 9.3453154078345	
Out[96]:
# current error = 9.345392981506	
Out[96]:
# current error = 9.3454681634947	
Out[96]:
# current error = 9.3455410220449	
Out[96]:
# current error = 9.3456116238335	
Out[96]:
# current error = 9.3456800339776	
Out[96]:
# current error = 9.3457463160446	
Out[96]:
# current error = 9.3458105320649	
Out[96]:
# current error = 9.3458727425465	
Out[96]:
# current error = 9.3459330064915	
Out[96]:
# current error = 9.3459913814142	
Out[96]:
# current error = 9.3460479233603	
Out[96]:
# current error = 9.3461026869284	
Out[96]:
# current error = 9.3461557252914	
Out[96]:
# current error = 9.3462070902194	
Out[96]:
# current error = 9.3462568321036	
Out[96]:
# current error = 9.3463049999804	
Out[96]:
# current error = 9.3463516415564	
Out[96]:
# current error = 9.3463968032339	
Out[96]:
# current error = 9.3464405301362	
Out[96]:
# current error = 9.3464828661341	
Out[96]:
# current error = 9.3465238538717	
Out[96]:
# current error = 9.3465635347929	
Out[96]:
# current error = 9.3466019491676	
Out[96]:
# current error = 9.346639136118	
Out[96]:
# current error = 9.3466751336451	
Out[96]:
# current error = 9.3467099786544	
Out[96]:
# current error = 9.3467437069824	
Out[96]:
# current error = 9.346776353422	
Out[96]:
# current error = 9.346807951748	
Out[96]:
# current error = 9.3468385347426	
Out[96]:
# current error = 9.3468681342203	
Out[96]:
# current error = 9.3468967810525	
Out[96]:
# current error = 9.3469245051917	
Out[96]:
# current error = 9.3469513356955	
Out[96]:
# current error = 9.3469773007504	
Out[96]:
# current error = 9.3470024276946	
Out[96]:
# current error = 9.3470267430409	
Out[96]:
# current error = 9.3470502724991	
Out[96]:
# current error = 9.3470730409979	
Out[96]:
# current error = 9.3470950727064	
Out[96]:
# current error = 9.3471163910549	
Out[96]:
# current error = 9.3471370187561	
Out[96]:
# current error = 9.3471569778245	
Out[96]:
# current error = 9.347176289597	
Out[96]:
# current error = 9.3471949747514	
Out[96]:
# current error = 9.3472130533259	
Out[96]:
# current error = 9.347230544737	
Out[96]:
# current error = 9.3472474677979	
Out[96]:
# current error = 9.3472638407357	
Out[96]:
# current error = 9.347279681209	
Out[96]:
# current error = 9.347295006324	
Out[96]:
# current error = 9.3473098326513	
Out[96]:
# current error = 9.3473241762415	
Out[96]:
# current error = 9.3473380526406	
Out[96]:
# current error = 9.3473514769054	
Out[96]:
# current error = 9.3473644636177	
Out[96]:
# current error = 9.3473770268991	
Out[96]:
# current error = 9.3473891804245	
Out[96]:
# current error = 9.3474009374355	
Out[96]:
# current error = 9.3474123107543	
Out[96]:
# current error = 9.3474233127954	
Out[96]:
# current error = 9.3474339555789	
Out[96]:
# current error = 9.3474442507424	
Out[96]:
# current error = 9.3474542095524	
Out[96]:
# current error = 9.3474638429161	
Out[96]:
# current error = 9.3474731613922	
Out[96]:
# current error = 9.347482175202	
Out[96]:
# current error = 9.3474908942396	
Out[96]:
# current error = 9.3474993280822	
Out[96]:
# current error = 9.3475074859998	
Out[96]:
# current error = 9.3475153769649	
Out[96]:
# current error = 9.3475230096621	
Out[96]:
# current error = 9.3475303924964	
Out[96]:
# current error = 9.3475375336025	
Out[96]:
# current error = 9.3475444408534	
Out[96]:
# current error = 9.3475511218681	
Out[96]:
# current error = 9.3475575840202	
Out[96]:
# current error = 9.347563834445	
Out[96]:
# current error = 9.3475698800477	
Out[96]:
# current error = 9.3475757275103	
Out[96]:
# current error = 9.3475813832988	
Out[96]:
# current error = 9.3475868536698	
Out[96]:
# current error = 9.3475921446776	
Out[96]:
# current error = 9.3475972621803	
Out[96]:
# current error = 9.3476022118462	
Out[96]:
# current error = 9.3476069991598	
Out[96]:
# current error = 9.3476116294277	
Out[96]:
# current error = 9.3476161077841	
Out[96]:
# current error = 9.3476204391968	
Out[96]:
# current error = 9.3476246284719	
Out[96]:
# current error = 9.3476286802594	
Out[96]:
# current error = 9.3476325990582	
Out[96]:
# current error = 9.3476363892209	
Out[96]:
# current error = 9.3476400549581	
Out[96]:
# current error = 9.3476436003437	
Out[96]:
# current error = 9.3476470293188	
Out[96]:
# current error = 9.3476503456961	
Out[96]:
# current error = 9.3476535531641	
Out[96]:
# current error = 9.3476566552909	
Out[96]:
# current error = 9.3476596555284	
Out[96]:
# current error = 9.3476625572159	
Out[96]:
# current error = 9.3476653635835	
Out[96]:
# current error = 9.3476680777562	
Out[96]:
# current error = 9.3476707027568	
Out[96]:
# current error = 9.3476732415093	
Out[96]:
# current error = 9.3476756968424	
Out[96]:
# current error = 9.3476780714921	
Out[96]:
# current error = 9.3476803681053	
Out[96]:
# current error = 9.347682589242	
Out[96]:
# current error = 9.3476847373787	
Out[96]:
# current error = 9.347686814911	
Out[96]:
# current error = 9.3476888241559	
Out[96]:
# current error = 9.3476907673548	
Out[96]:
# current error = 9.3476926466755	
Out[96]:
# current error = 9.3476944642151	
Out[96]:
# current error = 9.3476962220019	
Out[96]:
# current error = 9.3476979219978	
Out[96]:
# current error = 9.3476995661005	
Out[96]:
# current error = 9.3477011561454	
Out[96]:
# current error = 9.3477026939079	
Out[96]:
# current error = 9.3477041811053	
Out[96]:
# current error = 9.3477056193983	
Out[96]:
# current error = 9.3477070103935	
Out[96]:
# current error = 9.3477083556447	
Out[96]:
# current error = 9.3477096566548	
Out[96]:
# current error = 9.3477109148773	
Out[96]:
# current error = 9.3477121317182	
Out[96]:
# current error = 9.3477133085372	
Out[96]:
# current error = 9.3477144466495	
Out[96]:
# current error = 9.3477155473273	
Out[96]:
# current error = 9.3477166118008	
Out[96]:
# current error = 9.3477176412599	
Out[96]:
# current error = 9.3477186368556	
Out[96]:
# current error = 9.3477195997009	
Out[96]:
# current error = 9.3477205308725	
Out[96]:
# current error = 9.3477214314116	
Out[96]:
# current error = 9.3477223023252	
Out[96]:
# current error = 9.3477231445873	
Out[96]:
# current error = 9.3477239591399	
Out[96]:
# current error = 9.3477247468942	
Out[96]:
# current error = 9.3477255087312	
Out[96]:
# current error = 9.3477262455032	
Out[96]:
# current error = 9.3477269580344	
Out[96]:
# current error = 9.3477276471219	
Out[96]:
# current error = 9.3477283135368	
Out[96]:
# current error = 9.3477289580245	
Out[96]:
# current error = 9.3477295813063	
Out[96]:
# current error = 9.3477301840796	
Out[96]:
# current error = 9.3477307670189	
Out[96]:
# current error = 9.3477313307766	
Out[96]:
# current error = 9.3477318759836	
Out[96]:
# current error = 9.34773240325	
Out[96]:
# current error = 9.347732913166	
Out[96]:
# current error = 9.3477334063023	
Out[96]:
# current error = 9.3477338832109	
Out[96]:
# current error = 9.3477343444257	
Out[96]:
# current error = 9.3477347904628	
Out[96]:
# current error = 9.3477352218216	
Out[96]:
# current error = 9.347735638985	
Out[96]:
# current error = 9.3477360424199	
Out[96]:
# current error = 9.3477364325782	
Out[96]:
# current error = 9.3477368098964	
Out[96]:
# current error = 9.3477371747972	
Out[96]:
# current error = 9.347737527689	
Out[96]:
# current error = 9.3477378689669	
Out[96]:
# current error = 9.3477381990132	
Out[96]:
# current error = 9.3477385181973	
Out[96]:
# current error = 9.3477388268766	
Out[96]:
# current error = 9.3477391253968	
Out[96]:
# current error = 9.3477394140922	
Out[96]:
# current error = 9.347739693286	
Out[96]:
# current error = 9.347739963291	
Out[96]:
# current error = 9.3477402244094	
Out[96]:
# current error = 9.3477404769337	
Out[96]:
# current error = 9.3477407211467	
Out[96]:
# current error = 9.3477409573219	
Out[96]:
# current error = 9.3477411857239	
Out[96]:
# current error = 9.3477414066083	
Out[96]:
# current error = 9.3477416202226	
Out[96]:
# current error = 9.3477418268061	
Out[96]:
# current error = 9.3477420265901	
Out[96]:
# current error = 9.3477422197984	
Out[96]:
# current error = 9.3477424066474	
Out[96]:
# current error = 9.3477425873463	
Out[96]:
# current error = 9.3477427620976	
Out[96]:
# current error = 9.3477429310971	
Out[96]:
# current error = 9.3477430945339	
Out[96]:
# current error = 9.3477432525912	
Out[96]:
# current error = 9.3477434054461	
Out[96]:
# current error = 9.3477435532697	
Out[96]:
# current error = 9.3477436962276	
Out[96]:
# current error = 9.34774383448	
Out[96]:
# current error = 9.3477439681817	
Out[96]:
# current error = 9.3477440974826	
Out[96]:
# current error = 9.3477442225274	
Out[96]:
# current error = 9.3477443434563	
Out[96]:
# current error = 9.3477444604046	
Out[96]:
# current error = 9.3477445735035	
Out[96]:
# current error = 9.3477446828796	
Out[96]:
# current error = 9.3477447886555	
Out[96]:
# current error = 9.3477448909496	
Out[96]:
# current error = 9.3477449898765	
Out[96]:
# current error = 9.3477450855471	
Out[96]:
# current error = 9.3477451780686	
Out[96]:
# current error = 9.3477452675445	
Out[96]:
# current error = 9.3477453540752	
Out[96]:
# current error = 9.3477454377576	
Out[96]:
# current error = 9.3477455186855	
Out[96]:
# current error = 9.3477455969494	
Out[96]:
# current error = 9.3477456726371	
Out[96]:
# current error = 9.3477457458334	
Out[96]:
# current error = 9.3477458166203	
Out[96]:
# current error = 9.3477458850771	
Out[96]:
# current error = 9.3477459512805	
Out[96]:
# current error = 9.3477460153046	
Out[96]:
# current error = 9.3477460772213	
Out[96]:
# current error = 9.3477461370998	
Out[96]:
# current error = 9.3477461950073	
Out[96]:
# current error = 9.3477462510085	
Out[96]:
# current error = 9.3477463051664	
Out[96]:
# current error = 9.3477463575415	
Out[96]:
# current error = 9.3477464081926	
Out[96]:
# current error = 9.3477464571763	
Out[96]:
# current error = 9.3477465045477	
Out[96]:
# current error = 9.3477465503596	
Out[96]:
# current error = 9.3477465946635	
Out[96]:
# current error = 9.3477466375091	
Out[96]:
# current error = 9.3477466789442	
Out[96]:
# current error = 9.3477467190155	
Out[96]:
# current error = 9.3477467577676	
Out[96]:
# current error = 9.3477467952441	
Out[96]:
# current error = 9.3477468314869	
Out[96]:
# current error = 9.3477468665368	
Out[96]:
# current error = 9.3477469004328	
Out[96]:
# current error = 9.347746933213	
Out[96]:
# current error = 9.3477469649142	
Out[96]:
# current error = 9.3477469955719	
Out[96]:
# current error = 9.3477470252203	
Out[96]:
# current error = 9.3477470538928	
Out[96]:
# current error = 9.3477470816214	
Out[96]:
# current error = 9.3477471084373	
Out[96]:
# current error = 9.3477471343704	
Out[96]:
# current error = 9.3477471594499	
Out[96]:
# current error = 9.3477471837037	
Out[96]:
# current error = 9.3477472071592	
Out[96]:
# current error = 9.3477472298426	
Out[96]:
# current error = 9.3477472517793	
Out[96]:
# current error = 9.3477472729938	
Out[96]:
# current error = 9.34774729351	
Out[96]:
# current error = 9.3477473133509	
Out[96]:
# current error = 9.3477473325386	
Out[96]:
# current error = 9.3477473510947	
Out[96]:
# current error = 9.3477473690399	
Out[96]:
# current error = 9.3477473863945	
Out[96]:
# current error = 9.3477474031777	
Out[96]:
# current error = 9.3477474194085	
Out[96]:
# current error = 9.3477474351049	
Out[96]:
# current error = 9.3477474502847	
Out[96]:
# current error = 9.3477474649648	
Out[96]:
# current error = 9.3477474791616	
Out[96]:
# current error = 9.3477474928911	
Out[96]:
# current error = 9.3477475061686	
Out[96]:
# current error = 9.3477475190091	
Out[96]:
# current error = 9.3477475314268	
Out[96]:
# current error = 9.3477475434358	
Out[96]:
# current error = 9.3477475550495	
Out[96]:
# current error = 9.3477475662808	
Out[96]:
# current error = 9.3477475771425	
Out[96]:
# current error = 9.3477475876466	
Out[96]:
# current error = 9.3477475978049	
Out[96]:
# current error = 9.3477476076288	
Out[96]:
# current error = 9.3477476171293	
Out[96]:
# current error = 9.3477476263171	
Out[96]:
# current error = 9.3477476352025	
Out[96]:
# current error = 9.3477476437953	
Out[96]:
# current error = 9.3477476521053	
Out[96]:
# current error = 9.3477476601417	
Out[96]:
# current error = 9.3477476679136	
Out[96]:
# current error = 9.3477476754296	
Out[96]:
# current error = 9.3477476826982	
Out[96]:
# current error = 9.3477476897276	
Out[96]:
# current error = 9.3477476965255	
Out[96]:
# current error = 9.3477477030997	
Out[96]:
# current error = 9.3477477094574	
Out[96]:
# current error = 9.3477477156059	
Out[96]:
# current error = 9.347747721552	
Out[96]:
# current error = 9.3477477273023	
Out[96]:
# current error = 9.3477477328633	
Out[96]:
# current error = 9.3477477382413	
Out[96]:
# current error = 9.3477477434422	
Out[96]:
# current error = 9.347747748472	
Out[96]:
# current error = 9.3477477533361	
Out[96]:
# current error = 9.3477477580402	
Out[96]:
# current error = 9.3477477625893	
Out[96]:
# current error = 9.3477477669888	
Out[96]:
# current error = 9.3477477712434	
Out[96]:
# current error = 9.3477477753579	
Out[96]:
# current error = 9.347747779337	
Out[96]:
# current error = 9.3477477831852	
Out[96]:
# current error = 9.3477477869066	
Out[96]:
# current error = 9.3477477905055	
Out[96]:
# current error = 9.347747793986	
Out[96]:
# current error = 9.3477477973519	
Out[96]:
# current error = 9.347747800607	
Out[96]:
# current error = 9.3477478037549	
Out[96]:
# current error = 9.3477478067992	
Out[96]:
# current error = 9.3477478097433	
Out[96]:
# current error = 9.3477478125905	
Out[96]:
# current error = 9.3477478153439	
Out[96]:
# current error = 9.3477478180068	
Out[96]:
# current error = 9.3477478205819	
Out[96]:
# current error = 9.3477478230723	
Out[96]:
# current error = 9.3477478254807	
Out[96]:
# current error = 9.3477478278098	
Out[96]:
# current error = 9.3477478300623	
Out[96]:
# current error = 9.3477478322406	
Out[96]:
# current error = 9.3477478343472	
Out[96]:
# current error = 9.3477478363844	
Out[96]:
# current error = 9.3477478383546	
Out[96]:
# current error = 9.3477478402599	
Out[96]:
# current error = 9.3477478421026	
Out[96]:
# current error = 9.3477478438845	
Out[96]:
# current error = 9.3477478456078	
Out[96]:
# current error = 9.3477478472744	
Out[96]:
# current error = 9.3477478488861	
Out[96]:
# current error = 9.3477478504447	
Out[96]:
# current error = 9.3477478519521	
Out[96]:
# current error = 9.3477478534098	
Out[96]:
# current error = 9.3477478548195	
Out[96]:
# current error = 9.3477478561828	
Out[96]:
# current error = 9.3477478575013	
Out[96]:
# current error = 9.3477478587763	
Out[96]:
# current error = 9.3477478600094	
Out[96]:
# current error = 9.3477478612019	
Out[96]:
# current error = 9.3477478623551	
Out[96]:
# current error = 9.3477478634704	
Out[96]:
# current error = 9.3477478645489	
Out[96]:
# current error = 9.347747865592	
Out[96]:
# current error = 9.3477478666007	
Out[96]:
# current error = 9.3477478675762	
Out[96]:
# current error = 9.3477478685196	
Out[96]:
# current error = 9.3477478694319	
Out[96]:
# current error = 9.3477478703142	
Out[96]:
# current error = 9.3477478711675	
Out[96]:
# current error = 9.3477478719926	
Out[96]:
# current error = 9.3477478727906	
Out[96]:
# current error = 9.3477478735624	
Out[96]:
# current error = 9.3477478743087	
Out[96]:
# current error = 9.3477478750305	
Out[96]:
# current error = 9.3477478757285	
Out[96]:
# current error = 9.3477478764035	
Out[96]:
# current error = 9.3477478770563	
Out[96]:
# current error = 9.3477478776876	
Out[96]:
# current error = 9.3477478782982	
Out[96]:
# current error = 9.3477478788886	
Out[96]:
# current error = 9.3477478794596	
Out[96]:
# current error = 9.3477478800118	
Out[96]:
# current error = 9.3477478805458	
Out[96]:
# current error = 9.3477478810623	
Out[96]:
# current error = 9.3477478815617	
Out[96]:
# current error = 9.3477478820447	
Out[96]:
# current error = 9.3477478825118	
Out[96]:
# current error = 9.3477478829635	
Out[96]:
# current error = 9.3477478834004	
Out[96]:
# current error = 9.3477478838229	
Out[96]:
# current error = 9.3477478842314	
Out[96]:
# current error = 9.3477478846266	
Out[96]:
# current error = 9.3477478850087	
Out[96]:
# current error = 9.3477478853782	
Out[96]:
# current error = 9.3477478857356	
Out[96]:
# current error = 9.3477478860812	
Out[96]:
# current error = 9.3477478864154	
Out[96]:
# current error = 9.3477478867386	
Out[96]:
# current error = 9.3477478870512	
Out[96]:
# current error = 9.3477478873535	
Out[96]:
# current error = 9.3477478876459	
Out[96]:
# current error = 9.3477478879286	
Out[96]:
# current error = 9.347747888202	
Out[96]:
# current error = 9.3477478884664	
Out[96]:
# current error = 9.3477478887221	
Out[96]:
# current error = 9.3477478889694	
Out[96]:
# current error = 9.3477478892086	
Out[96]:

Out[96]:
# current error = 9.3477478894398	
Out[96]:
# current error = 9.3477478896635	
Out[96]:
# current error = 9.3477478898798	
Out[96]:
# current error = 9.347747890089	
Out[96]:
# current error = 9.3477478902913	
Out[96]:
# current error = 9.3477478904869	
Out[96]:
# current error = 9.3477478906761	
Out[96]:
# current error = 9.3477478908591	
Out[96]:
# current error = 9.347747891036	
Out[96]:
# current error = 9.3477478912071	
Out[96]:
# current error = 9.3477478913726	
Out[96]:
# current error = 9.3477478915327	
Out[96]:
# current error = 9.3477478916874	
Out[96]:
# current error = 9.3477478918371	
Out[96]:
# current error = 9.3477478919819	
Out[96]:
# current error = 9.3477478921218	
Out[96]:
# current error = 9.3477478922572	
Out[96]:
# current error = 9.3477478923882	
Out[96]:
# current error = 9.3477478925147	
Out[96]:
# current error = 9.3477478926372	
Out[96]:
# current error = 9.3477478927556	
Out[96]:
# current error = 9.3477478928701	
Out[96]:
# current error = 9.3477478929809	
Out[96]:
# current error = 9.347747893088	
Out[96]:
# current error = 9.3477478931915	
Out[96]:
# current error = 9.3477478932917	
Out[96]:
# current error = 9.3477478933886	
Out[96]:
# current error = 9.3477478934822	
Out[96]:
# current error = 9.3477478935728	
Out[96]:
# current error = 9.3477478936604	
Out[96]:
# current error = 9.3477478937452	
Out[96]:
# current error = 9.3477478938271	
Out[96]:
# current error = 9.3477478939064	
Out[96]:
# current error = 9.347747893983	
Out[96]:
# current error = 9.3477478940571	
Out[96]:
# current error = 9.3477478941288	
Out[96]:
# current error = 9.3477478941981	
Out[96]:
# current error = 9.3477478942651	
Out[96]:
# current error = 9.3477478943299	
Out[96]:
# current error = 9.3477478943926	
Out[96]:
# current error = 9.3477478944532	
Out[96]:
# current error = 9.3477478945119	
Out[96]:
# current error = 9.3477478945686	
Out[96]:
# current error = 9.3477478946234	
Out[96]:
# current error = 9.3477478946764	
Out[96]:
# current error = 9.3477478947277	
Out[96]:
# current error = 9.3477478947773	
Out[96]:
# current error = 9.3477478948253	
Out[96]:
# current error = 9.3477478948716	
Out[96]:
# current error = 9.3477478949165	
Out[96]:
# current error = 9.3477478949599	
Out[96]:
# current error = 9.3477478950018	
Out[96]:
# current error = 9.3477478950424	
Out[96]:
# current error = 9.3477478950816	
Out[96]:
# current error = 9.3477478951196	
Out[96]:
# current error = 9.3477478951563	
Out[96]:
# current error = 9.3477478951918	
Out[96]:
# current error = 9.3477478952261	
Out[96]:
# current error = 9.3477478952593	
Out[96]:
# current error = 9.3477478952914	
Out[96]:
# current error = 9.3477478953224	
Out[96]:
# current error = 9.3477478953524	
Out[96]:
# current error = 9.3477478953814	
Out[96]:
# current error = 9.3477478954095	
Out[96]:
# current error = 9.3477478954367	
Out[96]:
# current error = 9.3477478954629	
Out[96]:
# current error = 9.3477478954883	
Out[96]:
# current error = 9.3477478955129	
Out[96]:
# current error = 9.3477478955366	
Out[96]:
# current error = 9.3477478955596	
Out[96]:
# current error = 9.3477478955818	
Out[96]:
# current error = 9.3477478956033	
Out[96]:
# current error = 9.347747895624	
Out[96]:
# current error = 9.3477478956441	
Out[96]:
# current error = 9.3477478956636	
Out[96]:
# current error = 9.3477478956823	
Out[96]:
# current error = 9.3477478957005	
Out[96]:
# current error = 9.3477478957181	
Out[96]:
# current error = 9.3477478957351	
Out[96]:
# current error = 9.3477478957515	
Out[96]:
# current error = 9.3477478957674	
Out[96]:
# current error = 9.3477478957828	
Out[96]:
# current error = 9.3477478957976	
Out[96]:
# current error = 9.347747895812	
Out[96]:
# current error = 9.3477478958259	
Out[96]:
# current error = 9.3477478958393	
Out[96]:
# current error = 9.3477478958523	
Out[96]:
# current error = 9.3477478958649	
Out[96]:
# current error = 9.3477478958771	
Out[96]:
# current error = 9.3477478958888	
Out[96]:
# current error = 9.3477478959002	
Out[96]:
# current error = 9.3477478959112	
Out[96]:
# current error = 9.3477478959218	
Out[96]:
# current error = 9.3477478959321	
Out[96]:
# current error = 9.3477478959421	
Out[96]:
# current error = 9.3477478959517	
Out[96]:
# current error = 9.347747895961	
Out[96]:
# current error = 9.34774789597	
Out[96]:
# current error = 9.3477478959787	
Out[96]:
# current error = 9.3477478959871	
Out[96]:
# current error = 9.3477478959952	
Out[96]:
# current error = 9.3477478960031	
Out[96]:
# current error = 9.3477478960107	
Out[96]:
# current error = 9.3477478960181	
Out[96]:
# current error = 9.3477478960252	
Out[96]:
# current error = 9.3477478960321	
Out[96]:
# current error = 9.3477478960387	
Out[96]:
# current error = 9.3477478960452	
Out[96]:
# current error = 9.3477478960514	
Out[96]:
# current error = 9.3477478960574	
Out[96]:
# current error = 9.3477478960632	
Out[96]:
# current error = 9.3477478960689	
Out[96]:
# current error = 9.3477478960743	
Out[96]:
# current error = 9.3477478960796	
Out[96]:
# current error = 9.3477478960847	
Out[96]:
# current error = 9.3477478960896	
Out[96]:
# current error = 9.3477478960944	
Out[96]:
# current error = 9.3477478960989	
Out[96]:
# current error = 9.3477478961034	
Out[96]:
# current error = 9.3477478961077	
Out[96]:
# current error = 9.3477478961119	
Out[96]:
# current error = 9.3477478961159	
Out[96]:
# current error = 9.3477478961198	
Out[96]:
# current error = 9.3477478961236	
Out[96]:
# current error = 9.3477478961272	
Out[96]:
# current error = 9.3477478961307	
Out[96]:
# current error = 9.3477478961341	
Out[96]:
# current error = 9.3477478961374	
Out[96]:
# current error = 9.3477478961406	
Out[96]:
# current error = 9.3477478961437	
Out[96]:
# current error = 9.3477478961467	
Out[96]:
# current error = 9.3477478961496	
Out[96]:
# current error = 9.3477478961524	
Out[96]:
# current error = 9.3477478961551	
Out[96]:
# current error = 9.3477478961577	
Out[96]:
# current error = 9.3477478961602	
Out[96]:
# current error = 9.3477478961626	
Out[96]:
# current error = 9.347747896165	
Out[96]:
# current error = 9.3477478961673	
Out[96]:
# current error = 9.3477478961695	
Out[96]:
# current error = 9.3477478961716	
Out[96]:
# current error = 9.3477478961737	
Out[96]:
# current error = 9.3477478961757	
Out[96]:
# current error = 9.3477478961776	
Out[96]:
# current error = 9.3477478961795	
Out[96]:
# current error = 9.3477478961813	
Out[96]:
# current error = 9.347747896183	
Out[96]:
# current error = 9.3477478961847	
Out[96]:
# current error = 9.3477478961863	
Out[96]:
# current error = 9.3477478961879	
Out[96]:
# current error = 9.3477478961894	
Out[96]:
# current error = 9.3477478961909	
Out[96]:
# current error = 9.3477478961923	
Out[96]:
# current error = 9.3477478961937	
Out[96]:
# current error = 9.347747896195	
Out[96]:
# current error = 9.3477478961963	
Out[96]:
# current error = 9.3477478961976	
Out[96]:
# current error = 9.3477478961988	
Out[96]:
# current error = 9.3477478962	
Out[96]:
# current error = 9.3477478962011	
Out[96]:
# current error = 9.3477478962022	
Out[96]:
# current error = 9.3477478962032	
Out[96]:
# current error = 9.3477478962043	
Out[96]:
# current error = 9.3477478962052	
Out[96]:
# current error = 9.3477478962062	
Out[96]:
# current error = 9.3477478962071	
Out[96]:
# current error = 9.347747896208	
Out[96]:
# current error = 9.3477478962089	
Out[96]:
# current error = 9.3477478962097	
Out[96]:
# current error = 9.3477478962105	
Out[96]:
# current error = 9.3477478962113	
Out[96]:
# current error = 9.3477478962121	
Out[96]:
# current error = 9.3477478962128	
Out[96]:
# current error = 9.3477478962135	
Out[96]:
# current error = 9.3477478962142	
Out[96]:
# current error = 9.3477478962148	
Out[96]:
# current error = 9.3477478962155	
Out[96]:
# current error = 9.3477478962161	
Out[96]:
# current error = 9.3477478962167	
Out[96]:
# current error = 9.3477478962173	
Out[96]:
# current error = 9.3477478962178	
Out[96]:
# current error = 9.3477478962184	
Out[96]:
# current error = 9.3477478962189	
Out[96]:
# current error = 9.3477478962194	
Out[96]:
# current error = 9.3477478962199	
Out[96]:
# current error = 9.3477478962204	
Out[96]:
# current error = 9.3477478962208	
Out[96]:
# current error = 9.3477478962213	
Out[96]:
# current error = 9.3477478962217	
Out[96]:
# current error = 9.3477478962221	
Out[96]:
# current error = 9.3477478962225	
Out[96]:
# current error = 9.3477478962229	
Out[96]:
# current error = 9.3477478962233	
Out[96]:
# current error = 9.3477478962236	
Out[96]:
# current error = 9.347747896224	
Out[96]:
# current error = 9.3477478962243	
Out[96]:
# current error = 9.3477478962246	
Out[96]:
# current error = 9.347747896225	
Out[96]:
# current error = 9.3477478962253	
Out[96]:
# current error = 9.3477478962256	
Out[96]:
# current error = 9.3477478962259	
Out[96]:
# current error = 9.3477478962261	
Out[96]:
# current error = 9.3477478962264	
Out[96]:
# current error = 9.3477478962267	
Out[96]:
# current error = 9.3477478962269	
Out[96]:
# current error = 9.3477478962271	
Out[96]:
# current error = 9.3477478962274	
Out[96]:
# current error = 9.3477478962276	
Out[96]:
# current error = 9.3477478962278	
Out[96]:
# current error = 9.347747896228	
Out[96]:
# current error = 9.3477478962282	
Out[96]:
# current error = 9.3477478962284	
Out[96]:
# current error = 9.3477478962286	
Out[96]:
# current error = 9.3477478962288	
Out[96]:
# current error = 9.347747896229	
Out[96]:
# current error = 9.3477478962292	
Out[96]:
# current error = 9.3477478962293	
Out[96]:
# current error = 9.3477478962295	
Out[96]:
# current error = 9.3477478962297	
Out[96]:
# current error = 9.3477478962298	
Out[96]:
# current error = 9.34774789623	
Out[96]:
# current error = 9.3477478962301	
Out[96]:
# current error = 9.3477478962302	
Out[96]:
# current error = 9.3477478962304	
Out[96]:
# current error = 9.3477478962305	
Out[96]:
# current error = 9.3477478962306	
Out[96]:
# current error = 9.3477478962307	
Out[96]:
# current error = 9.3477478962309	
Out[96]:
# current error = 9.347747896231	
Out[96]:
# current error = 9.3477478962311	
Out[96]:
# current error = 9.3477478962312	
Out[96]:
# current error = 9.3477478962313	
Out[96]:
# current error = 9.3477478962314	
Out[96]:
# current error = 9.3477478962315	
Out[96]:
# current error = 9.3477478962316	
Out[96]:
# current error = 9.3477478962317	
Out[96]:
# current error = 9.3477478962317	
Out[96]:
# current error = 9.3477478962318	
Out[96]:
# current error = 9.3477478962319	
Out[96]:
# current error = 9.347747896232	
Out[96]:
# current error = 9.3477478962321	
Out[96]:
# current error = 9.3477478962321	
Out[96]:
# current error = 9.3477478962322	
Out[96]:
# current error = 9.3477478962323	
Out[96]:
# current error = 9.3477478962323	
Out[96]:
# current error = 9.3477478962324	
Out[96]:
# current error = 9.3477478962325	
Out[96]:
# current error = 9.3477478962325	
Out[96]:
# current error = 9.3477478962326	
Out[96]:
# current error = 9.3477478962326	
Out[96]:
# current error = 9.3477478962327	
Out[96]:
# current error = 9.3477478962327	
Out[96]:
# current error = 9.3477478962328	
Out[96]:
# current error = 9.3477478962328	
Out[96]:
# current error = 9.3477478962329	
Out[96]:
# current error = 9.3477478962329	
Out[96]:
# current error = 9.347747896233	
Out[96]:
# current error = 9.347747896233	
Out[96]:
# current error = 9.347747896233	
Out[96]:
# current error = 9.3477478962331	
Out[96]:
# current error = 9.3477478962331	
Out[96]:
# current error = 9.3477478962332	
Out[96]:
# current error = 9.3477478962332	
Out[96]:
# current error = 9.3477478962332	
Out[96]:
# current error = 9.3477478962333	
Out[96]:
# current error = 9.3477478962333	
Out[96]:
# current error = 9.3477478962333	
Out[96]:
# current error = 9.3477478962334	
Out[96]:
# current error = 9.3477478962334	
Out[96]:
# current error = 9.3477478962334	
Out[96]:
# current error = 9.3477478962335	
Out[96]:
# current error = 9.3477478962335	
Out[96]:
# current error = 9.3477478962335	
Out[96]:
# current error = 9.3477478962335	
Out[96]:
# current error = 9.3477478962336	
Out[96]:
# current error = 9.3477478962336	
Out[96]:
# current error = 9.3477478962336	
Out[96]:
# current error = 9.3477478962336	
Out[96]:
# current error = 9.3477478962336	
Out[96]:
# current error = 9.3477478962337	
Out[96]:
# current error = 9.3477478962337	
Out[96]:
# current error = 9.3477478962337	
Out[96]:
# current error = 9.3477478962337	
Out[96]:
# current error = 9.3477478962337	
Out[96]:
# current error = 9.3477478962338	
Out[96]:
# current error = 9.3477478962338	
Out[96]:
# current error = 9.3477478962338	
Out[96]:
# current error = 9.3477478962338	
Out[96]:
# current error = 9.3477478962338	
Out[96]:
# current error = 9.3477478962338	
Out[96]:
# current error = 9.3477478962338	
Out[96]:
# current error = 9.3477478962339	
Out[96]:
# current error = 9.3477478962339	
Out[96]:
# current error = 9.3477478962339	
Out[96]:
# current error = 9.3477478962339	
Out[96]:
# current error = 9.3477478962339	
Out[96]:
# current error = 9.3477478962339	
Out[96]:
# current error = 9.3477478962339	
Out[96]:
# current error = 9.3477478962339	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.347747896234	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962341	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962342	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
Out[96]:
# current error = 9.3477478962343	
# StochasticGradient: you have reached the maximum number of iterations	
# training error = 9.3477478962343	

5. test the network, print accuracy


In [97]:
predicted = net:forward(trainset.data[33])

In [100]:
print(predicted, trainset.label[33])


Out[100]:
 2.2103
[torch.DoubleTensor of size 1]

 12.1340
[torch.DoubleTensor of size 1]


In [99]:
correct = 0
for i=1,trainset:size() do
    local predicted = net:forward(trainset.data[i])
    sqr = (predicted - trainset.label[i])*(predicted - trainset.label[i])
    correct = correct + sqr
end
print(correct / trainset:size())


Out[99]:
9.1436367823572	

In [101]:
net


Out[101]:
nn.Sequential {
  [input -> (1) -> output]
  (1): nn.Linear(1 -> 1)
}
{
  gradInput : DoubleTensor - size: 1
  modules : 
    {
      1 : 
        nn.Linear(1 -> 1)
        {
          gradBias : DoubleTensor - size: 1
          weight : DoubleTensor - size: 1x1
          bias : DoubleTensor - size: 1
          gradInput : DoubleTensor - size: 1
          gradWeight : DoubleTensor - size: 1x1
          output : DoubleTensor - size: 1
        }
    }
  output : DoubleTensor - size: 1
}

In [104]:
net.modules[1].weight


Out[104]:
 1.3044
[torch.DoubleTensor of size 1x1]


In [105]:
net.modules[1].bias


Out[105]:
-4.8815
[torch.DoubleTensor of size 1]


In [ ]: