Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base/otrav.h house of horrors #21

Closed
rcurtin opened this issue Dec 28, 2014 · 0 comments
Closed

base/otrav.h house of horrors #21

rcurtin opened this issue Dec 28, 2014 · 0 comments

Comments

@rcurtin
Copy link
Member

rcurtin commented Dec 28, 2014

Reported by rcurtin on 17 Dec 40289662 18:13 UTC
I looked in otrav.h to discover possibly the scariest thing I've seen in years. I think I may mail a letter to Sonny Perdue to get this kind of stuff legally outlawed.

Currently the object traversal system is written entirely in #define macros. I was trying to figure out why and this wonderful list of svn commits was presented to me:
http://trac.research.cc.gatech.edu/fastlab/log/fastlib/base/otrav.h?rev=912
(14 of Garry's 22 commit messages read "hi")

The system clearly fills a niche, allowing an easy way to do object traversal of your classes. But there has to be a better way. Doing it with #define macros is a crime against humanity.

This will require a lot of thought. Maybe a job for the Curiously Recurring Template Pattern (http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern)?

@rcurtin rcurtin self-assigned this Dec 28, 2014
@rcurtin rcurtin closed this as completed Dec 28, 2014
rcurtin pushed a commit that referenced this issue Apr 8, 2019
… Class

Updated SparseSVMFunction and added basic implementation of SparseSVM Class.

List of changes:

1) Moved the code for `sparse_svm_function.hpp` and `sparse_svm_function_impl.hpp`under the mlpack namespace.
2) Fixed missing dependency issue for `MakeAlias` and `ShuffleData` in `sparse_svm_function_impl.hpp`.
3) Added `EvaluateWithGradient()` for `SparseSVMFunction` class.
4) Added a basic starter code for `SparseSVM` class.
fixed syntax issues


fixed syntax issues


fixed syntax issues


fixed inconsistency in optimizer type


fixed some inconsistency 


updated SparseSVM::Classify and added  SparseSVM::ComputeAccuracy()


updated SparseSVM::Classify() and added SparseSVM::ComputeAccuracy().

List of changes.

- updated `SparseSVM::Classify()`.
- added `SparseSVM::ComputeAccuracy()`.
- removed `SparseSVM::FeatureSize()` since `parameters` is a concatenated vector of `w` and `b`.
- added `sparse_svm.hpp` and `sparse_svm.cpp` to `../sparse_svm/CMakeLists.txt`.
fixed SparseSVMFunction::Evaluate() and  fixed an issue in SparseSVM::Classify() (#21)

* fixed SparseSVMFunction::Evaluate()

Updated the function definition for `SparseSVMFunction::Evaluate()` and `SparseSVMFunction::EvaluateWithGradient()` and used arma::clamp().

* fixed an issue in SparseSVM::Classify()

The issue was related to typecasting. The parameter inside `arma::size()` should have the same type as that of `labels`.

Updated SparseSVMFunction::Evaluate() and SparseSVMFunction::Gradient().


First Small Test for class SparseSVMFunction


Fixed Syntax issue and some other issue.


Added SparseSVMFunctionRandomEvaluate test.


test: SparseSVMFunctionGradient


added sparse_svm_impl.hpp


Templatized SparseSVM and SparseSVMFunction.


Updated implementation of SparseSVMFunction.

This takes into account the fact that labels is of type `arma::Row<size_t>` and converts it into appropriate type for the calculation of hinge loss.
Added L2-Regularization.


Added Documentation.


Updated implementation to adapt multiple class classification.


fixed syntax inconsistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant