Permalink
Browse files

Function approximation made more compact

  • Loading branch information...
1 parent 6a3ca63 commit 530e3eb7cb4ee2d1312c79c1615885dd671eed81 @psibi committed Apr 6, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 fapprox.py
View
@@ -313,16 +313,16 @@ def test(self):
width=20
once=True
for ite in range(len(inputs)):
- a=inputs.pop()
- b=a.split(' ')
- sample=b[1]
- second=sample[:-1]
- inpu=(int(b[0]),int(second))
- calc_out=self.ann.run(inpu)
+ a=inputs.pop(0).split(' ')
+ finpu = []
+ for i in a:
+ if i!='\n':
+ finpu.append(float(i))
+ calc_out=self.ann.run(tuple(finpu))
i=""
header=""
- for x in range(len(inpu)):
- i=i+"\t"+str(inpu[x]).ljust(width)
+ for x in range(len(finpu)):
+ i=i+"\t"+str(finpu[x]).ljust(width)
header=header+"\t"+"Input #"+str(x)
header.rjust(width)
if once:

0 comments on commit 530e3eb

Please sign in to comment.