Skip to content

Instantly share code, notes, and snippets.

View rcurtin's full-sized avatar
💭
breathing

Ryan Curtin rcurtin

💭
breathing
View GitHub Profile
diff --git a/CMake/exec2man.sh b/CMake/exec2man.sh
index b0807fc61..adef5a53d 100755
--- a/CMake/exec2man.sh
+++ b/CMake/exec2man.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Convert the output of an MLPACK executable into a man page. This assumes that
+# Convert the output of an mlpack executable into a man page. This assumes that
# the CLI subsystem is used to output help, that the executable is properly
# documented, and that the program is run in the directory that the executable
@rcurtin
rcurtin / 0001-Add-rvalue-reference-constructor-to-FastMKSModel.patch
Created April 11, 2018 15:11
0001-Add-rvalue-reference-constructor-to-FastMKSModel.patch
From d26d4208a2e121d310f8d5f29fc5d2183b6fdacb Mon Sep 17 00:00:00 2001
From: Ryan Curtin <ryan@ratml.org>
Date: Wed, 11 Apr 2018 11:10:10 -0400
Subject: [PATCH] Add rvalue reference constructor to FastMKSModel.
This fixes the use of deallocated memory in fastmks_main.cpp.
---
src/mlpack/methods/fastmks/fastmks.hpp | 50 ++++++++++
src/mlpack/methods/fastmks/fastmks_impl.hpp | 110 ++++++++++++++++++++++
src/mlpack/methods/fastmks/fastmks_main.cpp | 14 +--
diff --git a/src/mlpack/methods/lmnn/lmnn_function_impl.hpp b/src/mlpack/methods/lmnn/lmnn_function_impl.hpp
index b9fb88ad6..5de8e8279 100644
--- a/src/mlpack/methods/lmnn/lmnn_function_impl.hpp
+++ b/src/mlpack/methods/lmnn/lmnn_function_impl.hpp
@@ -193,6 +193,8 @@ double LMNNFunction<MetricType>::Evaluate(const arma::mat& transformation,
begin, batchSize);
}
+ size_t prunes = 0;
+ size_t checks = 0;
diff --git a/src/mlpack/methods/lmnn/lmnn_function.hpp b/src/mlpack/methods/lmnn/lmnn_function.hpp
index fab543e2c..ee2a5144b 100644
--- a/src/mlpack/methods/lmnn/lmnn_function.hpp
+++ b/src/mlpack/methods/lmnn/lmnn_function.hpp
@@ -257,7 +257,7 @@ class LMNNFunction
const size_t begin,
const size_t batchSize);
// Recalculate impostors.
- inline void ReCalculateImpostors(const arma::mat& transformedDataset,
+ inline bool ReCalculateImpostors(const arma::mat& transformedDataset,
diff --git a/src/mlpack/core/optimizers/bigbatch_sgd/adaptive_stepsize.hpp b/src/mlpack/core/optimizers/bigbatch_sgd/adaptive_stepsize.hpp
index 54019bf40..baf67c31b 100644
--- a/src/mlpack/core/optimizers/bigbatch_sgd/adaptive_stepsize.hpp
+++ b/src/mlpack/core/optimizers/bigbatch_sgd/adaptive_stepsize.hpp
@@ -83,6 +83,7 @@ class AdaptiveStepsize
const size_t backtrackingBatchSize,
const bool /* reset */)
{
+ std::cout << "update, step size " << stepSize << "\n";
Backtracking(function, stepSize, iterate, gradient, gradientNorm, offset,
From fc4ede42c03e232e7528f628b5c0ba9764c9e728 Mon Sep 17 00:00:00 2001
From: Ryan Curtin <ryan@ratml.org>
Date: Thu, 15 Nov 2018 21:18:55 -0500
Subject: [PATCH] Refactor to use ensmallen optimizers always.
---
src/mlpack/core.hpp | 1 +
src/mlpack/core/CMakeLists.txt | 1 -
src/mlpack/core/data/CMakeLists.txt | 1 +
src/mlpack/core/data/dataset_mapper_utils.hpp | 53 +++++++
module cli
export CLIRestoreSettings
export CLISetParam
export CLISetParamMat
export CLISetParamUMat
export CLISetParamRow
export CLISetParamCol
export CLISetParamURow
export CLISetParamUCol
export knn
using mlpack.cli
using Libdl
pwd = @__DIR__
if !(pwd in Libdl.DL_LOAD_PATH)
push!(Libdl.DL_LOAD_PATH, pwd)
end
.
├── build
│   ├── bin
│   │   ├── generate_jl_adaboost
│   │   ├── generate_jl_approx_kfn
│   │   ├── generate_jl_cf
│   │   ├── generate_jl_dbscan
│   │   ├── generate_jl_decision_stump
│   │   ├── generate_jl_decision_tree
│   │   ├── generate_jl_det
module mlpack
include("cli.jl")
include("test_julia_binding.jl")
include("adaboost.jl")
include("approx_kfn.jl")
include("cf.jl")
include("dbscan.jl")
include("decision_stump.jl")
include("decision_tree.jl")