1// Protocol messages for describing features for machine learning model 2// training or inference. 3// 4// There are three base Feature types: 5// - bytes 6// - float 7// - int64 8// 9// A Feature contains Lists which may hold zero or more values. These 10// lists are the base values BytesList, FloatList, Int64List. 11// 12// Features are organized into categories by name. The Features message 13// contains the mapping from name to Feature. 14// 15// Example Features for a movie recommendation application: 16// feature { 17// key: "age" 18// value { float_list { 19// value: 29.0 20// }} 21// } 22// feature { 23// key: "movie" 24// value { bytes_list { 25// value: "The Shawshank Redemption" 26// value: "Fight Club" 27// }} 28// } 29// feature { 30// key: "movie_ratings" 31// value { float_list { 32// value: 9.0 33// value: 9.7 34// }} 35// } 36// feature { 37// key: "suggestion" 38// value { bytes_list { 39// value: "Inception" 40// }} 41// } 42// feature { 43// key: "suggestion_purchased" 44// value { int64_list { 45// value: 1 46// }} 47// } 48// feature { 49// key: "purchase_price" 50// value { float_list { 51// value: 9.99 52// }} 53// } 54// 55 56syntax = "proto3"; 57 58package tensorflow; 59 60option cc_enable_arenas = true; 61option java_outer_classname = "FeatureProtos"; 62option java_multiple_files = true; 63option java_package = "org.tensorflow.example"; 64option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto"; 65 66// LINT.IfChange 67// Containers to hold repeated fundamental values. 68message BytesList { 69 repeated bytes value = 1; 70} 71message FloatList { 72 repeated float value = 1 [packed = true]; 73} 74message Int64List { 75 repeated int64 value = 1 [packed = true]; 76} 77 78// Containers for non-sequential data. 79message Feature { 80 // Each feature can be exactly one kind. 81 oneof kind { 82 BytesList bytes_list = 1; 83 FloatList float_list = 2; 84 Int64List int64_list = 3; 85 } 86} 87 88message Features { 89 // Map from feature name to feature. 90 map<string, Feature> feature = 1; 91} 92 93// Containers for sequential data. 94// 95// A FeatureList contains lists of Features. These may hold zero or more 96// Feature values. 97// 98// FeatureLists are organized into categories by name. The FeatureLists message 99// contains the mapping from name to FeatureList. 100// 101message FeatureList { 102 repeated Feature feature = 1; 103} 104 105message FeatureLists { 106 // Map from feature name to feature list. 107 map<string, FeatureList> feature_list = 1; 108} 109// LINT.ThenChange( 110// https://www.tensorflow.org/code/tensorflow/python/training/training.py) 111