Created simple_server example for running a basic NuPIC model api #2213
Conversation
|
||
MODEL_PARAMS = { | ||
# Type of model that the rest of these parameters apply to. | ||
'model': "CLA", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you just import the model params from the hotgym example file? to avoid duplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really mind having duplicate model params within example code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Examples aren't on the PYTHONPATH so importing between them is hacky at best. I think it is a good idea to share the suggested parameters though. @tomsilver added something similar for making standard network configurations reusable:
https://github.com/numenta/nupic/blob/master/nupic/engine/common_networks/__init__.py
👍 |
|
||
|
||
|
||
g_models = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if #1929 gets merged, this can be simplified
@scottpurdy Did you see this? There is a use-case in this PR for @breznak's global dict in #1929. @jaredweiss is keeping a |
@rhyolight @breznak - What benefit is there from GlobalDict instead of a regular dict? It seems like that just adds another dependency and uses a custom class that people reading the code may not know about. |
Any update on the |
#!/usr/bin/env python | ||
# ---------------------------------------------------------------------- | ||
# Numenta Platform for Intelligent Computing (NuPIC) | ||
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year
@jaredweiss ad |
@@ -0,0 +1,247 @@ | |||
|
|||
# Numenta Platform for Intelligent Computing (NuPIC) | |||
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year
@jaredweiss I would say proceed with |
@jaredweiss ping |
@jaredweiss - Please ping me when you're ready for me to look again |
@scottpurdy It looks done to me but I'm still having that import error when I try to run the server from the directory it's in. Outside the directory it works fine. I think its got something to do with swig. |
What's the exception message? |
|
@jaredweiss - When you are in the
|
For avoiding the import error, do something like this, after copyright header and doc string but before the first import:
|
…ix 'import web' when simple_server was run from within nupic directory.
@scottpurdy ping |
@scottpurdy Ping! Not sure if you've looked over my most recent commit yet. |
|
||
|
||
if __name__ == "__main__": | ||
parser = OptionParser() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend argparse which is replacing optparse but let's not hold up this example
Created simple_server example for running a basic NuPIC model api
Created simple_server example for running a basic NuPIC model api
fixes #2212
Created a basic server for trying out NuPIC models with an easy to use api