W3cubDocs

/TensorFlow Python

tf.contrib.layers.crossed_column(columns, hash_bucket_size, combiner=None, ckpt_to_load_from=None, tensor_name_in_ckpt=None, hash_key=None)

tf.contrib.layers.crossed_column(columns, hash_bucket_size, combiner=None, ckpt_to_load_from=None, tensor_name_in_ckpt=None, hash_key=None)

See the guide: Layers (contrib) > Feature columns

Creates a _CrossedColumn for performing feature crosses.

Args:

  • columns: An iterable of _FeatureColumn. Items can be an instance of _SparseColumn, _CrossedColumn, or _BucketizedColumn.
  • hash_bucket_size: An int that is > 1. The number of buckets.
  • combiner: A combiner string, supports sum, mean, sqrtn.
  • ckpt_to_load_from: (Optional). String representing checkpoint name/pattern to restore the column weights. Required if tensor_name_in_ckpt is not None.
  • tensor_name_in_ckpt: (Optional). Name of the Tensor in the provided checkpoint from which to restore the column weights. Required if ckpt_to_load_from is not None.
  • hash_key: Specify the hash_key that will be used by the FingerprintCat64 function to combine the crosses fingerprints on SparseFeatureCrossOp (optional).

Returns:

A _CrossedColumn.

Raises:

  • TypeError: if any item in columns is not an instance of _SparseColumn, _CrossedColumn, or _BucketizedColumn, or hash_bucket_size is not an int.
  • ValueError: if hash_bucket_size is not > 1 or len(columns) is not > 1.

Defined in tensorflow/contrib/layers/python/layers/feature_column.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/layers/crossed_column