add inv
This commit is contained in:
parent
ee2e388228
commit
92616a8c3d
@ -30,7 +30,8 @@ graph(::typeof(mean), x, dim=nothing) = TensorFlow.reduce_mean(x;axis=dim)
|
||||
graph(::typeof(svd), x) = svd(x)
|
||||
|
||||
for op in (*, .*, .+, .^, log, exp, ceil, floor, sqrt, abs, cos,
|
||||
sin, tan, atan, asin, acos, tanh, lgamma, erf, erfc, real, imag, conj)
|
||||
sin, tan, atan, asin, acos, tanh, lgamma, erf, erfc, real, imag, conj,
|
||||
inv)
|
||||
@eval graph(::typeof($op), args...) = $op(args...)
|
||||
end
|
||||
|
||||
|
@ -35,6 +35,12 @@ m = tf(f)
|
||||
u,s,v = m(A)
|
||||
@test maximum(abs.(u*diagm(s)*transpose(v) - A)) < error_margin
|
||||
|
||||
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
# inv
|
||||
@net f(x) = inv(x)
|
||||
m = tf(f)
|
||||
@test maximum(abs.(m(A)-inv(A))) < error_margin
|
||||
|
||||
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user