From 2bdd175a6eb1f6edd8689987fef1a29fc1043da1 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado <55825613+luevano@users.noreply.github.com> Date: Tue, 25 Feb 2020 20:42:15 -0700 Subject: Remove frobnorm, already in numpy --- ml_exp/math.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/ml_exp/math.py b/ml_exp/math.py index 781985118..e7c8dcabc 100644 --- a/ml_exp/math.py +++ b/ml_exp/math.py @@ -21,35 +21,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import numpy as np -import math - - -def frob_norm(array): - """ - Calculates the frobenius norm of a given array or matrix. - array: array of data. - """ - - arr_sh_len = len(array.shape) - arr_range = range(len(array)) - fn = 0.0 - - # If it is a 'vector'. - if arr_sh_len == 1: - for i in arr_range: - fn += array[i]*array[i] - - return math.sqrt(fn) - - # If it is a matrix. - elif arr_sh_len == 2: - for i in arr_range: - for j in arr_range: - fn += array[i, j]*array[i, j] - - return math.sqrt(fn) - else: - print('Error. Array size greater than 2 ({}).'.format(arr_sh_len)) def cholesky_solve(K, y): -- cgit v1.2.3-70-g09d2