org.platanios.tensorflow.api.ops.lookup
Scalar STRING
tensor containing the filename of the text file to be used for
initialization. The path must be accessible from wherever the graph is initialized (e.g.,
trainer or evaluation workers).
Data type of the table keys.
Data type of the table values.
Text file field extractor to use for the keys (e.g., TextFileLineNumber
).
Text file field extractor to use for the values (e.g., TextFileWholeLine
).
Delimiter to use in case a TextFileColumn
extractor is being used.
Number of elements in the file, if known. If not known, set to -1
(the default value).
Delimiter to use in case a TextFileColumn
extractor is being used.
Scalar STRING
tensor containing the filename of the text file to be used for
initialization.
Scalar STRING
tensor containing the filename of the text file to be used for
initialization. The path must be accessible from wherever the graph is initialized (e.g.,
trainer or evaluation workers).
Creates and returns an op that initializes the provided table.
Creates and returns an op that initializes the provided table.
Table to initialize.
Created initialization op for table
.
Data type of the table keys.
Data type of the table keys.
Text file field extractor to use for the keys (e.g., TextFileLineNumber
).
Data type of the table values.
Data type of the table values.
Text file field extractor to use for the values (e.g., TextFileWholeLine
).
Number of elements in the file, if known.
Number of elements in the file, if known. If not known, set to -1
(the default value).
Lookup table initializer that uses a text file.
This initializer assigns one entry in the table for each line in the file. The key and value types of the table to initialize are given by
keysDataType
andvaluesDataType
.The key and value content to extract from each line is specified by
keysExtractor
andvaluesExtractor
:TextFileLineNumber
: Use the line number (starting at zero -- expectsINT64
data type).TextFileWholeLine
: Use the whole line content.TextFileColumn(i)
: Use thei
th element of the split line based ondelimiter
.For example if we have a file with the following content:
The following code creates an op that initializes a table with the first column as keys and second column as values:
Similarly to initialize the whole line as keys and the line number as values: