| /************************************************************ |
| * |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| * |
| *************************************************************/ |
| |
| package singa; |
| |
| enum MsgType { |
| kGet = 0; |
| kPut = 1; |
| kSync = 2; |
| kUpdate = 3; |
| kSyncRequest = 4; |
| kSyncResponse = 5; |
| kStop = 6; |
| kData = 7; |
| kRGet = 8; |
| kRUpdate = 9; |
| kConnect = 10; |
| kMetric = 11; |
| }; |
| |
| enum EntityType { |
| kWorkerParam = 0; |
| kWorkerLayer = 1; |
| kServer = 2; |
| kStub = 3; |
| kRuntime = 4; |
| }; |
| |
| enum ConnectionType { |
| kOneToOne = 0; |
| kOneToAll = 1; |
| kOneToMany = 2; |
| } |
| |
| // to import caffe's lmdb dataset |
| message CaffeDatum { |
| optional int32 channels = 1; |
| optional int32 height = 2; |
| optional int32 width = 3; |
| // the actual image data, in bytes |
| optional bytes data = 4; |
| optional int32 label = 5; |
| // Optionally, the datum could also hold float data. |
| repeated float float_data = 6; |
| // If true data contains an encoded image that need to be decoded |
| optional bool encoded = 7 [default = false]; |
| } |
| |
| // to import caffe's blob, e.g., image mean |
| message CaffeBlob { |
| optional int32 num = 1 [default = 0]; |
| optional int32 channels = 2 [default = 0]; |
| optional int32 height = 3 [default = 0]; |
| optional int32 width = 4 [default = 0]; |
| repeated float data = 5 [packed = true]; |
| repeated float diff = 6 [packed = true]; |
| } |
| |
| message BlobProto { |
| repeated int32 shape = 1; |
| repeated float data = 2 [packed = true]; |
| } |
| |
| message BlobProtos { |
| repeated int32 id = 2; |
| repeated int32 version = 3; |
| repeated string name = 4; |
| repeated BlobProto blob = 5; |
| } |
| |
| message Record { |
| enum Type { |
| // each record contains image raw feature and its label. |
| kSingleLabelImage = 0; |
| } |
| optional Type type = 1 [default = kSingleLabelImage]; |
| optional string user_type =2; |
| // configuration for |
| optional RecordProto image = 5; |
| |
| extensions 101 to 200; |
| } |
| |
| // rename SingleLabelImageRecord to RecordProto |
| message RecordProto { |
| repeated int32 shape = 1; |
| optional int32 label = 2; |
| optional bytes pixel = 3; |
| repeated float data = 4 [packed = true]; |
| } |
| |
| message MetricProto { |
| repeated string name = 1; |
| repeated int32 count = 2; |
| repeated float val = 3; |
| } |