Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
COBREXA.jl
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LCSB-BioCore
COBREXA.jl
Commits
6abcc2e4
Unverified
Commit
6abcc2e4
authored
3 years ago
by
St. Elmo
Browse files
Options
Downloads
Patches
Plain Diff
new warmup points, halfway done with sampler
parent
d5e0ff6a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/analysis/sampling/hit_and_run.jl
+8
-16
8 additions, 16 deletions
src/analysis/sampling/hit_and_run.jl
src/analysis/sampling/warmup.jl
+3
-2
3 additions, 2 deletions
src/analysis/sampling/warmup.jl
with
11 additions
and
18 deletions
src/analysis/sampling/hit_and_run.jl
+
8
−
16
View file @
6abcc2e4
...
...
@@ -56,31 +56,23 @@ function hit_and_run(
num_warmup_points
=
length
(
reactions
(
model
))
)
# generate warmup points
ws
=
flux_variability_analysis
(
model
,
collect
(
1
:
10
),
Tulip
.
Optimizer
;
bounds
=
objective_bounds
(
0.90
),
ret
=
m
->
COBREXA
.
JuMP
.
value
.
(
m
[
:
x
])
)
ws
,
lbs
,
ubs
=
warmup
(
model
,
optimizer
;
modifications
=
modifications
,
warmup_points
=
collect
(
1
:
num_warmup_points
))
nwpts
=
size
(
wpoints
,
2
)
# number of warmup points generated
samples
=
zeros
(
size
(
wpoints
,
1
),
samplesize
)
# sample storage
current_point
=
zeros
(
size
(
wpoints
,
1
))
current_point
.=
wpoints
[
:
,
rand
(
1
:
nwpts
)]
# pick random initial point
samples
=
zeros
(
length
(
lbs
),
samplesize
)
# sample storage
current_point
=
zeros
(
length
(
lbs
))
current_point
.
=
ws
[
1
,
1
]
# just use the first warmup point, randomness is introduced later
direction
=
zeros
(
length
(
lbs
))
sample_num
=
0
samplelength
=
0
u
pdatesamplesizelength
=
true
u
se_warmup_points
=
true
for
n
=
1
:
N
# direction = random point - current point
if
updatesamplesizelength
direction
_point
=
(
@view
wpoints
[
:
,
rand
(
1
:
nwpts
)])
-
(
@view
current_point
[
:
])
# use warmup points to find direction in warmup phase
direction
.
=
(
@view
wpoints
[
:
,
rand
(
1
:
nwpts
)])
-
(
@view
current_point
[
:
])
# use warmup points to find direction in warmup phase
else
direction
_point
=
direction
.
=
(
@view
samples
[
:
,
rand
(
1
:
(
samplelength
))])
-
(
@view
current_point
[
:
])
# after warmup phase, only find directions in sampled space
end
...
...
This diff is collapsed.
Click to expand it.
src/analysis/sampling/warmup.jl
+
3
−
2
View file @
6abcc2e4
...
...
@@ -33,6 +33,7 @@ function warmup(
# free the data on workers
map
(
fetch
,
remove_from
.
(
workers
,
:
warmup_model
))
return
fluxes
lbs
,
ubs
=
get_bound_vectors
(
optmodel
)
return
fluxes
,
lbs
,
ubs
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment