Skip to content

Instantly share code, notes, and snippets.

View rcurtin's full-sized avatar
💭
breathing

Ryan Curtin rcurtin

💭
breathing
View GitHub Profile
#include <mlpack/core.hpp>
#include <mlpack/methods/gmm/gmm.hpp>
PARAM_STRING_REQ("input_file", "Input dataset.", "i");
using namespace mlpack;
using namespace mlpack::distribution;
using namespace std;
int main(int argc, char** argv)
Index: softmax_regression.hpp
===================================================================
--- softmax_regression.hpp (revision 17497)
+++ softmax_regression.hpp (working copy)
@@ -61,7 +61,7 @@
class SoftmaxRegression
{
public:
-
+
From 6d16964d083a1af092f3ea25830487664c1c9cb3 Mon Sep 17 00:00:00 2001
From: Ryan Curtin <ryan@ratml.org>
Date: Thu, 10 Aug 2017 08:55:12 -0400
Subject: [PATCH] Refactor DatasetMapper to map any input type.
---
src/mlpack/core/data/dataset_mapper.hpp | 51 ++++++------
src/mlpack/core/data/dataset_mapper_impl.hpp | 93 +++++++++++-----------
.../core/data/map_policies/increment_policy.hpp | 63 +++++++++------
src/mlpack/core/util/param.hpp | 4 +-
@rcurtin
rcurtin / 0001-Partial-alias-layer-support.patch
Created August 13, 2017 16:34
patch for AliasLayer proof-of-concept
From 93d8d0c6e62adaa4bce7b7bd6e5ed64d9bd2cff4 Mon Sep 17 00:00:00 2001
From: Ryan Curtin <ryan@ratml.org>
Date: Sun, 13 Aug 2017 12:30:48 -0400
Subject: [PATCH] Partial alias layer support.
Still needs:
* Support for other methods that only some layers have.
* "Fake" parameters matrix so gradient updates work correctly?
* Fixing to pass the simple test I wrote.
---
From eba67e14b93b776f3136aff90679fa137b98822e Mon Sep 17 00:00:00 2001
From: Ryan Curtin <ryan@ratml.org>
Date: Wed, 20 Dec 2017 14:25:17 -0500
Subject: [PATCH] Update binding documentation for static main function.
---
doc/guide/bindings.hpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/doc/guide/bindings.hpp b/doc/guide/bindings.hpp
@rcurtin
rcurtin / fastmks_memory_fix.patch
Created January 11, 2018 20:21
Fix FastMKS serialize() memory leak
diff --git a/src/mlpack/core/metrics/ip_metric_impl.hpp b/src/mlpack/core/metrics/ip_metric_impl.hpp
index d39026593..5155eb380 100644
--- a/src/mlpack/core/metrics/ip_metric_impl.hpp
+++ b/src/mlpack/core/metrics/ip_metric_impl.hpp
@@ -65,6 +65,10 @@ template<typename Archive>
void IPMetric<KernelType>::serialize(Archive& ar,
const unsigned int /* version */)
{
+ // Delete an existing kernel.
+ if (kernelOwner)
@rcurtin
rcurtin / ipmetric_memory.patch
Created January 16, 2018 16:05
Memory fixes for FastMKS; correct this time.
diff --git a/src/mlpack/core/metrics/ip_metric.hpp b/src/mlpack/core/metrics/ip_metric.hpp
index a24552de3..8a8d48462 100644
--- a/src/mlpack/core/metrics/ip_metric.hpp
+++ b/src/mlpack/core/metrics/ip_metric.hpp
@@ -38,9 +38,21 @@ class IPMetric
//! Create the IPMetric with an instantiated kernel.
IPMetric(KernelType& kernel);
+ //! Create the IPMetric by copying the other IPMetric.
+ IPMetric(const IPMetric& other);
@rcurtin
rcurtin / fix.patch
Created February 7, 2018 00:27
Fix too-early programName access
diff --git a/src/mlpack/bindings/python/py_option.hpp b/src/mlpack/bindings/python/py_option.hpp
index b25be68a4..e85e8fb52 100644
--- a/src/mlpack/bindings/python/py_option.hpp
+++ b/src/mlpack/bindings/python/py_option.hpp
@@ -69,7 +69,8 @@ class PyOption
data.value = boost::any(defaultValue);
// Restore the parameters for this program.
- CLI::RestoreSettings(programName, false);
+ if (identifier != "verbose" && identifier != "copy_all_inputs")
diff --git a/CMake/exec2man.sh b/CMake/exec2man.sh
index b0807fc61..debff99c6 100755
--- a/CMake/exec2man.sh
+++ b/CMake/exec2man.sh
@@ -1,5 +1,5 @@
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