Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ffa88a6b
提交
ffa88a6b
authored
6月 25, 2021
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
6月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename aesara.tensor.nlinalg.lstsq class to Lstsq and create Op instance
上级
86282bdd
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
4 行删除
+8
-4
nlinalg.py
aesara/tensor/nlinalg.py
+4
-1
test_nlinalg.py
tests/tensor/test_nlinalg.py
+4
-3
没有找到文件。
aesara/tensor/nlinalg.py
浏览文件 @
ffa88a6b
...
@@ -591,7 +591,7 @@ def svd(a, full_matrices=1, compute_uv=1):
...
@@ -591,7 +591,7 @@ def svd(a, full_matrices=1, compute_uv=1):
return
SVD
(
full_matrices
,
compute_uv
)(
a
)
return
SVD
(
full_matrices
,
compute_uv
)(
a
)
class
l
stsq
(
Op
):
class
L
stsq
(
Op
):
__props__
=
()
__props__
=
()
...
@@ -618,6 +618,9 @@ class lstsq(Op):
...
@@ -618,6 +618,9 @@ class lstsq(Op):
outputs
[
3
][
0
]
=
zz
[
3
]
outputs
[
3
][
0
]
=
zz
[
3
]
lstsq
=
Lstsq
()
def
matrix_power
(
M
,
n
):
def
matrix_power
(
M
,
n
):
r"""Raise a square matrix, ``M``, to the (integer) power ``n``.
r"""Raise a square matrix, ``M``, to the (integer) power ``n``.
...
...
tests/tensor/test_nlinalg.py
浏览文件 @
ffa88a6b
...
@@ -16,6 +16,7 @@ from aesara.tensor.nlinalg import (
...
@@ -16,6 +16,7 @@ from aesara.tensor.nlinalg import (
det
,
det
,
eig
,
eig
,
eigh
,
eigh
,
lstsq
,
matrix_dot
,
matrix_dot
,
matrix_inverse
,
matrix_inverse
,
matrix_power
,
matrix_power
,
...
@@ -372,7 +373,7 @@ class TestLstsq:
...
@@ -372,7 +373,7 @@ class TestLstsq:
x
=
lmatrix
()
x
=
lmatrix
()
y
=
lmatrix
()
y
=
lmatrix
()
z
=
lscalar
()
z
=
lscalar
()
b
=
aesara
.
tensor
.
nlinalg
.
lstsq
()
(
x
,
y
,
z
)
b
=
lstsq
(
x
,
y
,
z
)
f
=
function
([
x
,
y
,
z
],
b
)
f
=
function
([
x
,
y
,
z
],
b
)
TestMatrix1
=
np
.
asarray
([[
2
,
1
],
[
3
,
4
]])
TestMatrix1
=
np
.
asarray
([[
2
,
1
],
[
3
,
4
]])
TestMatrix2
=
np
.
asarray
([[
17
,
20
],
[
43
,
50
]])
TestMatrix2
=
np
.
asarray
([[
17
,
20
],
[
43
,
50
]])
...
@@ -385,7 +386,7 @@ class TestLstsq:
...
@@ -385,7 +386,7 @@ class TestLstsq:
x
=
vector
()
x
=
vector
()
y
=
vector
()
y
=
vector
()
z
=
scalar
()
z
=
scalar
()
b
=
aesara
.
tensor
.
nlinalg
.
lstsq
()
(
x
,
y
,
z
)
b
=
lstsq
(
x
,
y
,
z
)
f
=
function
([
x
,
y
,
z
],
b
)
f
=
function
([
x
,
y
,
z
],
b
)
with
pytest
.
raises
(
np
.
linalg
.
linalg
.
LinAlgError
):
with
pytest
.
raises
(
np
.
linalg
.
linalg
.
LinAlgError
):
f
([
2
,
1
],
[
2
,
1
],
1
)
f
([
2
,
1
],
[
2
,
1
],
1
)
...
@@ -394,7 +395,7 @@ class TestLstsq:
...
@@ -394,7 +395,7 @@ class TestLstsq:
x
=
vector
()
x
=
vector
()
y
=
vector
()
y
=
vector
()
z
=
vector
()
z
=
vector
()
b
=
aesara
.
tensor
.
nlinalg
.
lstsq
()
(
x
,
y
,
z
)
b
=
lstsq
(
x
,
y
,
z
)
f
=
function
([
x
,
y
,
z
],
b
)
f
=
function
([
x
,
y
,
z
],
b
)
with
pytest
.
raises
(
np
.
linalg
.
LinAlgError
):
with
pytest
.
raises
(
np
.
linalg
.
LinAlgError
):
f
([
2
,
1
],
[
2
,
1
],
[
2
,
1
])
f
([
2
,
1
],
[
2
,
1
],
[
2
,
1
])
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论