diff options
-rw-r--r-- | ml_exp/math.py | 29 |
1 files changed, 0 insertions, 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): |