tf.contrib.layers.real_valued_column
Stay organized with collections
Save and categorize content based on your preferences.
Creates a _RealValuedColumn
for dense numeric data.
tf.contrib.layers.real_valued_column(
column_name, dimension=1, default_value=None, dtype=tf.dtypes.float32,
normalizer=None
)
Args |
column_name
|
A string defining real valued column name.
|
dimension
|
An integer specifying dimension of the real valued column. The
default is 1.
|
default_value
|
A single value compatible with dtype or a list of values
compatible with dtype which the column takes on during tf.Example parsing
if data is missing. When dimension is not None, a default value of None
will cause tf.io.parse_example to fail if an example does not contain this
column. If a single value is provided, the same value will be applied as
the default value for every dimension. If a list of values is provided,
the length of the list should be equal to the value of dimension . Only
scalar default value is supported in case dimension is not specified.
|
dtype
|
defines the type of values. Default value is tf.float32. Must be a
non-quantized, real integer or floating point type.
|
normalizer
|
If not None, a function that can be used to normalize the value
of the real valued column after default_value is applied for parsing.
Normalizer function takes the input tensor as its argument, and returns
the output tensor. (e.g. lambda x: (x - 3.0) / 4.2). Note that for
variable length columns, the normalizer should expect an input_tensor of
type SparseTensor .
|
Returns |
A _RealValuedColumn.
|
Raises |
TypeError
|
if dimension is not an int
|
ValueError
|
if dimension is not a positive integer
|
TypeError
|
if default_value is a list but its length is not equal to the
value of dimension .
|
TypeError
|
if default_value is not compatible with dtype.
|
ValueError
|
if dtype is not convertible to tf.float32.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[]]