Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 430d889e authored by hhakim's avatar hhakim
Browse files

Update the pyfaust wrapper to bind the Frobenius and Inf norms full_array and batch_size arguments.

parent f3a74f33
No related branches found
No related tags found
No related merge requests found
...@@ -109,8 +109,8 @@ class FaustCoreCpp ...@@ -109,8 +109,8 @@ class FaustCoreCpp
unsigned long long nnz()const; unsigned long long nnz()const;
void power_iteration(FPP* out, double threshold=.001, int max_num_its=100) const; void power_iteration(FPP* out, double threshold=.001, int max_num_its=100) const;
double norm2(double threshold=.001, int max_num_its=100) const; double norm2(double threshold=.001, int max_num_its=100) const;
double normFro() const; double normFro(const bool full_array, const int batch_size) const;
double normInf() const; double normInf(const bool full_array, const int batch_size) const;
double norm1(const bool full_array, const int batch_size) const; double norm1(const bool full_array, const int batch_size) const;
double get_nb_factors() const; double get_nb_factors() const;
unsigned int get_fact_nb_rows(unsigned int& i) const; unsigned int get_fact_nb_rows(unsigned int& i) const;
......
...@@ -212,15 +212,15 @@ void FaustCoreCpp<FPP,DEV>::power_iteration(FPP* out, double threshold, int max_ ...@@ -212,15 +212,15 @@ void FaustCoreCpp<FPP,DEV>::power_iteration(FPP* out, double threshold, int max_
} }
template<typename FPP, FDevice DEV> template<typename FPP, FDevice DEV>
double FaustCoreCpp<FPP,DEV>::normFro() const double FaustCoreCpp<FPP,DEV>::normFro(const bool full_array, const int batch_size) const
{ {
return this->transform->normFro(); return this->transform->normFro(full_array, batch_size);
} }
template<typename FPP, FDevice DEV> template<typename FPP, FDevice DEV>
double FaustCoreCpp<FPP,DEV>::normInf() const double FaustCoreCpp<FPP,DEV>::normInf(const bool full_array, const int batch_size) const
{ {
return this->transform->normInf(); return this->transform->normInf(full_array, batch_size);
} }
template<typename FPP, FDevice DEV> template<typename FPP, FDevice DEV>
......
...@@ -23,8 +23,8 @@ cdef extern from "FaustCoreCpp.h": ...@@ -23,8 +23,8 @@ cdef extern from "FaustCoreCpp.h":
unsigned long long nnz() const unsigned long long nnz() const
void power_iteration(FPP* out, double threshold, int max_num_its) const; void power_iteration(FPP* out, double threshold, int max_num_its) const;
double norm2(double threshold, int max_num_its) const double norm2(double threshold, int max_num_its) const
double normFro() const double normFro(const bool full_array, const int batch_size) const
double normInf() const double normInf(const bool full_array, const int batch_size) const
double norm1(const bool full_array, const int batch_size) const double norm1(const bool full_array, const int batch_size) const
@CPP_CORE_CLASS@[FPP]* normalize(int ord) const @CPP_CORE_CLASS@[FPP]* normalize(int ord) const
double get_nb_factors() const double get_nb_factors() const
......
...@@ -344,11 +344,11 @@ cdef class FaustCoreGen@TYPE_NAME@@PROC@: ...@@ -344,11 +344,11 @@ cdef class FaustCoreGen@TYPE_NAME@@PROC@:
if ord == 2: if ord == 2:
norm = self.@CORE_OBJ@.norm2(threshold, max_num_its) norm = self.@CORE_OBJ@.norm2(threshold, max_num_its)
elif ord == np.inf: elif ord == np.inf:
norm = self.@CORE_OBJ@.normInf() norm = self.@CORE_OBJ@.normInf(full_array, batch_size)
elif ord == 1: elif ord == 1:
norm = self.@CORE_OBJ@.norm1(full_array, batch_size); norm = self.@CORE_OBJ@.norm1(full_array, batch_size);
else: else:
norm = self.@CORE_OBJ@.normFro() norm = self.@CORE_OBJ@.normFro(full_array, batch_size)
return norm return norm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment