Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
liuyunshengsir
Python_690654
提交
a1ca6130
P
Python_690654
项目概览
liuyunshengsir
/
Python_690654
与 Fork 源项目一致
Fork自
inscode / Python
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Python_690654
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a1ca6130
编写于
10月 11, 2025
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sat Oct 11 11:06:00 CST 2025 inscode
上级
6ac9ba8a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
5 deletion
+10
-5
.gitignore
.gitignore
+1
-1
hello-world/checkpoint_epoch0.pth
hello-world/checkpoint_epoch0.pth
+0
-0
hello-world/checkpoint_epoch4.pth
hello-world/checkpoint_epoch4.pth
+0
-0
hello-world/main.py
hello-world/main.py
+9
-4
未找到文件。
.gitignore
浏览文件 @
a1ca6130
...
@@ -135,4 +135,4 @@ $RECYCLE.BIN/
...
@@ -135,4 +135,4 @@ $RECYCLE.BIN/
.DS_Store?
.DS_Store?
._*
._*
.Spotlight-V100
.Spotlight-V100
.Trashes
.Trashes._logger_
\ No newline at end of file
hello-world/checkpoint_epoch0.pth
浏览文件 @
a1ca6130
无法预览此类型文件
hello-world/checkpoint_epoch4.pth
浏览文件 @
a1ca6130
无法预览此类型文件
hello-world/main.py
浏览文件 @
a1ca6130
import
torch
import
numpy
as
np
import
numpy
as
np
np_array
=
np
.
array
([
1
,
2
,
3
])
# 定义矩阵 A 和向量 b
tensor
=
torch
.
from_numpy
(
np_array
)
A
=
np
.
array
([[
1
,
1
],
[
1
,
2
],
[
1
,
3
]])
# 设计矩阵(3x2)
print
(
tensor
)
b
=
np
.
array
([
1
,
2
,
2
])
# 观测值(3x1)
\ No newline at end of file
# 求解最小二乘问题
x
,
residuals
,
rank
,
singular_values
=
np
.
linalg
.
lstsq
(
A
,
b
,
rcond
=
None
)
print
(
"最优解 x:"
,
x
)
print
(
"残差平方和:"
,
residuals
)
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录