Skip to content

Instantly share code, notes, and snippets.

@christianramsey
Created January 5, 2018 15:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christianramsey/66a2dbabb8637763590ba82c2dc0cfaf to your computer and use it in GitHub Desktop.
Save christianramsey/66a2dbabb8637763590ba82c2dc0cfaf to your computer and use it in GitHub Desktop.
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as tflayers
x = tflayers.real_valued_column(np.linspace(0, 100, 101))
buckets = np.linspace(0, 100, 5).tolist()
x2 = tflayers.bucketized_column(x, buckets)
print(x2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment