Skip to content

Commit

Permalink
Replace dump() with define __str__ in AdaptiveScalarEncoder. Issue nu…
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavrai44 committed Apr 16, 2017
1 parent ae3e1e3 commit 2be4d17
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/nupic/encoders/adaptivescalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,9 @@ def topDownCompute(self, encoded):
return super(AdaptiveScalarEncoder, self).topDownCompute(encoded)


def dump(self):
"""
Prints details about current state to stdout.
"""
print "AdaptiveScalarEncoder:"
print " min: %f" % self.minval
print " max: %f" % self.maxval
print " w: %d" % self.w
print " n: %d" % self.n
print " resolution: %f" % self.resolution
print " radius: %f" % self.radius
print " periodic: %s" % self.periodic
print " nInternal: %d" % self.nInternal
print " rangeInternal: %f" % self.rangeInternal
print " padding: %d" % self.padding

def __str__(self):
return "AdaptiveScalarEncoder\nmin: %f\nmax: %f\nw: %d\nn: %d\nresolution: %f\nradius: %f\nperiodic: %f\nnInternal: %f\nrangeInternal: %f\npadding: %d" \
% (self.minval, self.maxval, self.w, self.n, self.resolution, self.radius, self.periodic, self.nInternal, self.rangeInternal, self.padding)

@classmethod
def read(cls, proto):
Expand Down

0 comments on commit 2be4d17

Please sign in to comment.