Skip to content

Commit

Permalink
slight pipeline changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hqkhan committed Apr 29, 2018
1 parent 27fe50c commit a17ca01
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions bindsnet/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,34 @@ def __init__(self, Network, Environment, **kwargs):

# Create figures based on desired plots inside kwargs
self.axs, self.ims = self.plot()
self.time = kwargs['time']
self.render = kwargs['render']
self.analysis = kwargs['analysis']


def step(self, time, render=False, plot=False):
def step(self):
'''
Step through an iteration
'''

# Get input from the environment
inpts = self.env.get()

# Run the network
self.network.run(inpts=inpts, time=time)
self.network.run(inpts=inpts, time=self.time)

# If an instance of OpenAI gym environment
#obs, reward, done, info = env.step(action)

# Update the plots
if plot:
if self.analysis:
self.plot()

# Based on the environment we could want to render
if render:
if self.render:
self.env.render()

def plot(self, inpt):
def plot(self):
'''
Plot monitor variables or desired variables?
'''
Expand All @@ -52,6 +55,13 @@ def normalize(self, src, target, norm):
self.network.connections[(src, target)].normalize(norm)


def reset(self):
'''
Reset the entire pipeline
'''
self.env.reset()
self.network._reset()




Expand Down

0 comments on commit a17ca01

Please sign in to comment.