Class/Object

org.platanios.tensorflow.api.ops.lookup

LookupTableTextFileInitializer

Related Docs: object LookupTableTextFileInitializer | package lookup

Permalink

class LookupTableTextFileInitializer extends LookupTableInitializer

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 and valuesDataType.

The key and value content to extract from each line is specified by keysExtractor and valuesExtractor:

For example if we have a file with the following content:

emerson 10
lake 20
palmer 30

The following code creates an op that initializes a table with the first column as keys and second column as values:

val table = HashTable(LookupTableTextFileInitializer(
  "text.txt", STRING, INT64, TextFileColumn(0), TextFileColumn(1), " "))

Similarly to initialize the whole line as keys and the line number as values:

val table = HashTable(LookupTableTextFileInitializer(
  "text.txt", STRING, INT64, TextFileWholeLine, TextFileLineNumber, " "))
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LookupTableTextFileInitializer
  2. LookupTableInitializer
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LookupTableTextFileInitializer(filename: Output, keysDataType: types.DataType, valuesDataType: types.DataType, keysExtractor: TextFileFieldExtractor, valuesExtractor: TextFileFieldExtractor, delimiter: String = "\t", vocabularySize: Int = 1)

    Permalink

    filename

    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).

    keysDataType

    Data type of the table keys.

    valuesDataType

    Data type of the table values.

    keysExtractor

    Text file field extractor to use for the keys (e.g., TextFileLineNumber).

    valuesExtractor

    Text file field extractor to use for the values (e.g., TextFileWholeLine).

    delimiter

    Delimiter to use in case a TextFileColumn extractor is being used.

    vocabularySize

    Number of elements in the file, if known. If not known, set to -1 (the default value).

    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. val delimiter: String

    Permalink

    Delimiter to use in case a TextFileColumn extractor is being used.

  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. val filename: Output

    Permalink

    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).

  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. def initialize(table: InitializableLookupTable, name: String = "LookupTableTextFileInitialize"): Op

    Permalink

    Creates and returns an op that initializes the provided table.

    Creates and returns an op that initializes the provided table.

    table

    Table to initialize.

    returns

    Created initialization op for table.

    Definition Classes
    LookupTableTextFileInitializerLookupTableInitializer
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. val keysDataType: types.DataType

    Permalink

    Data type of the table keys.

    Data type of the table keys.

    Definition Classes
    LookupTableTextFileInitializerLookupTableInitializer
  16. val keysExtractor: TextFileFieldExtractor

    Permalink

    Text file field extractor to use for the keys (e.g., TextFileLineNumber).

  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. val valuesDataType: types.DataType

    Permalink

    Data type of the table values.

    Data type of the table values.

    Definition Classes
    LookupTableTextFileInitializerLookupTableInitializer
  23. val valuesExtractor: TextFileFieldExtractor

    Permalink

    Text file field extractor to use for the values (e.g., TextFileWholeLine).

  24. val vocabularySize: Int

    Permalink

    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).

  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from LookupTableInitializer

Inherited from AnyRef

Inherited from Any

Ungrouped