Esempio n. 1
0
 def init_local(self, transmit):
     """
         Instantiate client and struct.
     """
     self.log.info('Init Local')
     train_set, valid_set, test_set = load_data('mnist.pkl.gz')
     model = LogisticModel(input_shape=(28, 28), n_out=10)
     trainer = NLL_Trainer(transmit, model, train_set, valid_set, test_set)
     self.client = LocalClient(trainer)
     self.processor.set_model_struct(model.struct)
Esempio n. 2
0
def parserArguments(parser):
    parser.add_argument('--proc' , dest = 'processes', nargs='*', default = ['naoqi-service'], help = 'processes to watch')
    parser.add_argument('--tout' , dest = 'timeout', type = int, default = '10000' , help = 'timeout in seconds')
    parser.add_argument('--step' , dest = 'step', type = int, default = '1' , help = 'period of recording in seconds')
    parser.add_argument('--rec' , dest = 'rec', nargs='*', default = ['local', 'remote'] , help = 'record mode, can be local or remote')
    parser.add_argument('--verb', '-v' , dest = 'v', type = int, default = V_DEBUG , help = 'record mode, can be local or remote')

####
####    GLOBALS
####
log = Logger(SERV_LOG_FILE, D_VERB)
log.info('[SERV PROC] Server is launched')
data                = Queue.Queue()
connection_table    = {}

datasets = load_data('mnist.pkl.gz')
train_set = datasets[0]
valid_set = datasets[1]
test_set = datasets[2]

model = LogisticModel(input_shape=28 * 28, n_out=10)
trainer = NLL_Trainer(data, model, train_set, valid_set, test_set)
trainer.start_record()

log.info('[SERV PROC] CPU Thread instantiated')
data_manager = DataManager(data, connection_table)
log.info('[SERV PROC] DATA Thread instantiated')

####
####    ServerFunctions
####