Created
July 15, 2018 21:45
-
-
Save securetorobert/886c99220cac67581b3d29ff00cda806 to your computer and use it in GitHub Desktop.
Training a model with l1 Regularization in TensorFlow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
optimizer = tf.train.FtrlOptimizer(learning_rate=0.01, l1_regularization_strength=0.1) | |
estimator = tf.estimator.LinearRegressor(feature_columns=feature_columns, optimizer=optimizer) | |
estimator.train(input_fn= lambda: input_fn(X_train, y_train), steps=20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment