Vyuh

Finite State Magic

Linear Algebra. Machine Learning

Last Modified on November 27, 2020

Tags: nn python numpy linalg

x and y are the inputs. Both are arrays of numbers. a, b and e are the outputs. a is a 2 dimensional array of numbers, b is an array of numbers, and e is a number. e is the squared norm of vector a*x+b-y. I think the following code should work.

import numpy

x = numpy.array([1,3,55,2])
y = numpy.array([12,4,5,2,5])

def try_random_linear_transform(x, y):
    a =numpy.random.rand(y.size,x.size)
    b = numpy.random.rand(y.size)
    o = numpy.matmul(a,x)+b - y
    e = o.dot(o)
    return (a,b,e)

I want to try a lot of times and find the path which a and b take to reduce e. In this way I wish to find a way to reach optimal values of a and b for various values of x and y.

I think concepts like optimization methods, monte carlo simulation, and, multivariate calculus are related to this. The quest to achieve a deterministic solution to a problem using random methods. Learning how to gamble well.