Apply L2 regularization to tensorflow variables

作者: ganhai 分类: 技术, 笔记 发布时间: 2017-11-30 20:56 ė 1171 6 没有评论

Basic steps to apply L2 regularization variables

  1. Firstly call tf.contrib.layers.l2_regularizer() to return a L2 regularization function, with regularization parameter lamda.
  2. Next define a tensorflow variable, with keyword parameter “regularizer”, this variable will be added to tf.GraphKeys.REGULARIZATION_LOSSES collections.
  3. Get the regularized variables from the collections, apply regularization and added to the loss.

Per Tensorflow 1.4 release notes, currently CUDA 8 and cuDNN 6 are supported.
CUDA 9 and cuDNN 7 will be supported in next release.
Download CUDA 8
Download cuDNN 6

Apply L2 regularization to tensorflow variables

本文出自扉启博客,转载时请注明出处及相应链接。

本文永久链接: https://www.feiqy.com/apply-l2-regularization-to-tensorflow-variables/

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Ɣ回顶部