-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fliu2
committed
Aug 22, 2017
1 parent
68c6be3
commit decd484
Showing
25 changed files
with
162 additions
and
897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import sys | ||
sys.path.append('../') | ||
|
||
|
||
from tensorlab.TensorDB import TensorDB | ||
from tensorlab.TensorDB import mongo_impl | ||
import yaml | ||
|
||
config=yaml.load(open('loader.yml','r').read()) | ||
print config | ||
dbc=config['TensorDB']['backend'] | ||
print dbc | ||
del dbc['type'] | ||
|
||
m = mongo_impl.MongoFsDBImpl(**dbc) | ||
|
||
|
||
|
||
db=TensorDB(studyID="DemoTensorLab",dbimpl=m,fsimpl=m) | ||
|
||
result=db.TrainLogGraph(''' query { | ||
trainHistory (epoch: 50,studyID: "run5") | ||
{ | ||
acc, | ||
stepTime | ||
} | ||
}''' | ||
) | ||
|
||
print result.data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TensorDB: | ||
backend: | ||
type: mongo | ||
port: 27018 | ||
db_name: mnistTensorDB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from tensor_db import TensorDB | ||
import mongo_impl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import graphene | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
class Log(graphene.Interface): | ||
studyID=graphene.String() | ||
epoch=graphene.Int() | ||
|
||
|
||
class Params(graphene.ObjectType): | ||
class Meta: | ||
interfaces = (Log,) | ||
|
||
modelParams=graphene.String() | ||
|
||
def resolve_modelParams(self,args,context,info): | ||
pass | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
class TrainLog(graphene.ObjectType): | ||
class Meta: | ||
interfaces = (Log,) | ||
|
||
|
||
stepTime=graphene.List(graphene.Float) | ||
|
||
acc=graphene.List(graphene.Float) | ||
|
||
|
||
def mf(args): | ||
|
||
print args['studyID'] | ||
t = TrainLog(studyID=args['studyID'],epoch=args['epoch']) | ||
t.acc=args['acc'] | ||
t.stepTime=args['step_time'] | ||
|
||
|
||
return t | ||
|
||
|
||
|
||
class LogQuery(graphene.ObjectType): | ||
trainHistory = graphene.List(lambda:TrainLog, studyID=graphene.String(), epoch=graphene.Int(),) | ||
|
||
|
||
def resolve_trainHistory(self, args, context, info): | ||
print "resolve" | ||
|
||
print args | ||
print context | ||
|
||
tdb=context['tdb'] | ||
|
||
print tdb | ||
p=tdb.queryTrainLog(args) | ||
|
||
return map(mf, p) | ||
|
||
|
||
gqlSchema = graphene.Schema(query=LogQuery) | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from Model import Model | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
from tensor_lab import * | ||
import mongo_impl | ||
from tensor_db import TensorDB | ||
|
||
from Model import Model | ||
from tensorlab.TensorDB import mongo_impl | ||
from Logger import DBLogger | ||
|
||
##from Model import Model | ||
##from Logger import DBLogger | ||
|
||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.