This file contains 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
################################################################################ | |
With 1 random shuffle, before iteration. | |
################################################################################ | |
λ hogwild/mc ∴ ./a.out -v | |
Thead share size : 25049701 | |
[INFO ] Called specialization | |
[INFO ] Start computing loss for iteration : 1 | |
[INFO ] Parallel SGD: iteration 1, objective 1.82124e+09. | |
[INFO ] Number of elements to shuffle : 100198806 | |
[INFO ] Start shuffle for iteration : 1 |
This file contains 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
λ mlpack_spike/hogwild ∴ g++ svm_main.cpp -O2 -std=c++11 -Wall -larmadillo -lmlpack -fopenmp | |
λ mlpack_spike/hogwild ∴ ./a.out | |
RMSE : 0.797936 | |
Initial loss : 70176.4 | |
Final loss : 114.332 | |
RMSE : 0.050055 | |
λ mlpack_spike/hogwild ∴ ./a.out | |
RMSE : 0.797936 | |
Initial loss : 70176.4 | |
Final loss : 114.369 |
This file contains 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
#include <mlpack/core.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/parallel_sgd.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/decay_policies/constant_step.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/sparse_mc_function.hpp> | |
using namespace std; | |
using namespace mlpack; | |
using namespace mlpack::optimization; | |
int main() | |
{ |
This file contains 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
#include <mlpack/core.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/parallel_sgd.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/decay_policies/constant_step.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/sparse_mc_function.hpp> | |
using namespace std; | |
using namespace mlpack::optimization; | |
int main() | |
{ | |
size_t numRows, numCols; |
This file contains 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
#include <mlpack/core.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/decay_policies/constant_step.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/parallel_sgd.hpp> | |
#include <mlpack/core/optimizers/parallel_sgd/sparse_mc_function.hpp> | |
using namespace std; | |
using namespace mlpack; | |
using namespace mlpack::optimization; | |
int main(int argc, char* argv[]) | |
{ |
This file contains 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
#include <armadillo> | |
#include <iostream> | |
int main() { | |
// Load the data from the file to memory | |
const size_t num_examples = 23149, num_features = 47236; | |
const size_t num_locations = 1780950; | |
// Lets first get the data in dense form | |
arma::umat locations(2, num_locations); |
This file contains 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
#include <atomic> | |
// Maintain the decison variable as std::atomic | |
std::atomic<float> x[10]; | |
void update(std::atomic<float> &f, float val){ | |
float old; | |
do { | |
old = f.load(); | |
} |
This file contains 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
#!/usr/bin/env python | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def showKMeans(data, clusters): | |
plt.clf() | |
plt.scatter(data[:, 0], data[:, 1]) | |
plt.scatter(clusters[:, 0], clusters[:, 1]) | |
plt.show() |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<Site BuildName="(empty)" | |
BuildStamp="20170607-1102-Experimental" | |
Name="(empty)" | |
Generator="ctest-3.7.2" | |
CompilerName="" | |
CompilerVersion="" | |
OSName="Linux" | |
Hostname="workstation" | |
OSRelease="4.10.0-21-generic" |
This file contains 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
/** | |
* @file naive_bayes_classifier_impl.hpp | |
* @author Parikshit Ram (pram@cc.gatech.edu) | |
* @author Vahab Akbarzadeh (v.akbarzadeh@gmail.com) | |
* @author Shihao Jing (shihao.jing810@gmail.com) | |
* | |
* A Naive Bayes Classifier which parametrically estimates the distribution of | |
* the features. This classifier makes its predictions based on the assumption | |
* that the features have been sampled from a set of Gaussians with diagonal | |
* covariance. |