You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

29 lines
612 B

defmodule Toolex do
import Matrex.Operators
import Kernel, except: [-: 1, +: 2, -: 2, *: 2, /: 2, <|>: 2]
import Matrex
# Full
def cost_d(yp, yr) do
subtract(yp, yr)
end
def sum_inline(a,b) do
# IO.puts inspect Enum.count(a)
a + (Enum.reduce(1..5, b, fn x, acc -> concat(acc, b, :rows) end))
end
# Inprogres
def sigm(x) do
1 / (1 + Math.pow(Math.e, (-x)))
end
def sigm_d(x) do
x * (1 - x)
end
def cost(yp, yr) do
m = yp - yr
Matrex.sum(Matrex.Operators.pow2(m))/Enum.count(m)
end
end