资源算法 tf-svm

tf-svm

2020-01-14 | |  32 |   0 |   0

Tensorflow Linear SVM

A demonstration of how you can use TensorFlow to implement a standard L2-regularized support vector machine (SVM) in primal form.

linear_svm.py optimizes the following SVM cost using gradient descent:

图片.png

The first part of the cost function, i.e. the regularization part, is implemented by the regularization_loss expression, and the second part is implemented by the hinge_loss expression in the code.

Run the code using

python linear_svm.py --train linearly_separable_data.csv --svmC 1 --verbose True --num_epochs 10

On a linearly separable, 2D data, the code gives the following decision boundary:

result.png

The code here is inspired by the repositorytry-tf.





上一篇: thundersvm

下一篇:NCE_SM_Pytorch

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...