Advanced Computing Platform for Theoretical Physics
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pengfei Zhou
GI based TN
Commits
cd68302b
Commit
cd68302b
authored
Aug 21, 2020
by
Pengfei Zhou
Browse files
nmf
parent
28f43199
Changes
1
Hide whitespace changes
Inline
Side-by-side
parallel_bp.py
View file @
cd68302b
...
...
@@ -142,8 +142,8 @@ if __name__ =='__main__' :
tensor2
=
torch
.
randn
(
args
.
bond
,
args
.
bond
,
dtype
=
torch
.
float64
,
device
=
'cpu'
)
tensor2
=
torch
.
triu
(
tensor2
)
+
torch
.
triu
(
tensor2
,
diagonal
=
1
).
t
()
mf
=
MeanField
(
G
,
torch
.
exp
(
beta
*
tensor2
),
beta
,
'cpu'
)
#
fe_bp=mf.BP()
#
print("free_energy={:.15g}".format(fe_bp.item()))
fe_bp
=
mf
.
BP
()
print
(
"free_energy={:.15g}"
.
format
(
fe_bp
.
item
()))
fe_nmf
=
mf
.
NMF
()
print
(
"free_energy={:.15g}"
.
format
(
fe_nmf
.
item
()))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment