Skip to content

Commit

Permalink
Merge pull request #184 from ThrunGroup/hotfixes
Browse files Browse the repository at this point in the history
BanditPAM `v3.0.4`
  • Loading branch information
motiwari authored Apr 22, 2022
2 parents ed13fdb + c61b910 commit 4e02556
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_style_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics --exclude headers/carma
- name: Lint with cpplint
run: |
cpplint --exclude=headers/carma --exclude=build --filter=-legal/copyright,-build/c++11 --recursive .
cpplint --exclude=headers/carma --exclude=build --filter=-legal/copyright,-build/c++11,-build/include_subdir --recursive .
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import distutils.sysconfig
import distutils.spawn

__version__ = "3.0.3"
__version__ = "3.0.4"

# TODO(@motiwari): Move this to a separate file
GHA = 'GITHUB_ACTIONS'
Expand Down
5 changes: 2 additions & 3 deletions src/algorithms/kmedoids_algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,8 @@ float KMedoids::LINF(
float KMedoids::cos(const arma::fmat& data,
const size_t i,
const size_t j) const {
return arma::dot(
data.col(i),
data.col(j)) / (arma::norm(data.col(i))* arma::norm(data.col(j)));
return 1 - (arma::dot(data.col(i), data.col(j))
/ (arma::norm(data.col(i)) * arma::norm(data.col(j))));
}

float KMedoids::manhattan(const arma::fmat& data,
Expand Down
4 changes: 0 additions & 4 deletions src/python_bindings/kmedoids_pywrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
namespace km {
PYBIND11_MODULE(banditpam, m) {
m.doc() = "BanditPAM Python library, implemented in C++";
m.def("get_max_threads", // TODO(@motiwari): change to get_num_threads
&omp_get_max_threads, "Returns max number of threads");
m.def("set_num_threads",
&omp_set_num_threads, "Set the maximum number of threads");
pybind11::class_<KMedoidsWrapper> cls(m, "KMedoids");
cls.def(pybind11::init<int, std::string, int, int, int>(),
pybind11::arg("n_medoids") = NULL,
Expand Down

0 comments on commit 4e02556

Please sign in to comment.