doc-ai / tensorio-ios

Tensor/IO for iOS, with support for on-device inference and training with TensorFlow and TensorFlow Lite
Other
31 stars 10 forks source link

Integration tests to do #104

Closed phildow closed 5 years ago

phildow commented 5 years ago

Integration tests that ensure the code I have so far works as expected across the TIOModelTrainer, TIOModel and bundle, and TIOFederatedTask and bundle.

Being to work out the TIOFederatedManager which will use all these classes in the same manner they are being tested, along with the TIOFleaClient, which will be responsible for the underlying client-server communications.

In the end, @even-steven ought to be able to execute federated training from a react native bridging module with a handful of code:

- (void)federateUpInHea {
  TIOFederatedManager *manager = [[TIOFederatedManager alloc] init];
  manager.dataSourceProvider = self;

  [manager registerForTasksForModelWithId:@"tio:///models/modelid/...";
  [manager checkForTasks];
}

- (id<TIOBatchDataSource>)dataSourceForTaskWithId:(NSString*)taskIdentifier {
  TIOBatch *batch = [[TIOBatch alloc] initWithKeys:@[@"image", @"labels"]];

  [batch addItem:@{
      @"image": someImage,
      @"labels": @(0)
    }];

  return [[TIOInMemoryBatchDataSource alloc] initWithBatch:batch];
}

There will be additional, optional callback methods that inform the client about what's happening with client/server communication and the training task, which will allow the module to bubble events back up into javascript space.