Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
pymc3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ynic-debian
pymc3
Commits
effe5c4a
Unverified
Commit
effe5c4a
authored
May 12, 2020
by
Tirth Patel
Committed by
GitHub
May 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small changes to speed up find_MAP (#3916)
parent
ccc78cbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
pymc3/tuning/starting.py
pymc3/tuning/starting.py
+3
-2
No files found.
pymc3/tuning/starting.py
View file @
effe5c4a
...
...
@@ -140,11 +140,11 @@ def find_MAP(
def
grad_logp
(
point
):
return
nan_to_num
(
-
dlogp_func
(
point
))
opt_result
=
fmin
(
cost_func
,
bij
.
map
(
start
)
,
fprime
=
grad_logp
,
*
args
,
**
kwargs
)
opt_result
=
fmin
(
cost_func
,
x0
,
fprime
=
grad_logp
,
*
args
,
**
kwargs
)
else
:
# Check to see if minimization function uses a starting value
if
"x0"
in
getargspec
(
fmin
).
args
:
opt_result
=
fmin
(
cost_func
,
bij
.
map
(
start
)
,
*
args
,
**
kwargs
)
opt_result
=
fmin
(
cost_func
,
x0
,
*
args
,
**
kwargs
)
else
:
opt_result
=
fmin
(
cost_func
,
*
args
,
**
kwargs
)
...
...
@@ -174,6 +174,7 @@ def find_MAP(
assert
isinstance
(
cost_func
.
progress
,
ProgressBar
)
cost_func
.
progress
.
total
=
last_v
cost_func
.
progress
.
update
(
last_v
)
print
()
vars
=
get_default_varnames
(
model
.
unobserved_RVs
,
include_transformed
)
mx
=
{
var
.
name
:
value
for
var
,
value
in
zip
(
vars
,
model
.
fastfn
(
vars
)(
bij
.
rmap
(
mx0
)))}
...
...
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