Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
4500e670
Commit
4500e670
authored
7 years ago
by
Pospelov, Gennady
Browse files
Options
Downloads
Patches
Plain Diff
Length of lines in Python scripts
parent
43287661
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
Examples/python/fitting/ex02_FitBasics/FitCylindersPrisms_detailed.py
+2
-1
2 additions, 1 deletion
...hon/fitting/ex02_FitBasics/FitCylindersPrisms_detailed.py
Examples/python/fitting/ex02_FitBasics/MinimizerOptions.py
+5
-4
5 additions, 4 deletions
Examples/python/fitting/ex02_FitBasics/MinimizerOptions.py
with
7 additions
and
5 deletions
Examples/python/fitting/ex02_FitBasics/FitCylindersPrisms_detailed.py
+
2
−
1
View file @
4500e670
...
@@ -69,7 +69,8 @@ def create_real_data():
...
@@ -69,7 +69,8 @@ def create_real_data():
real_data
.
setBinContent
(
i
,
noisy_amplitude
)
real_data
.
setBinContent
(
i
,
noisy_amplitude
)
# uncomment line to save generated data on disk
# uncomment line to save generated data on disk
#ba.IntensityDataIOFactory.writeIntensityData(real_data, 'refdata_fitcylinderprisms.int.gz')
#ba.IntensityDataIOFactory.writeIntensityData(
# real_data, 'refdata_fitcylinderprisms.int.gz')
return
real_data
return
real_data
...
...
This diff is collapsed.
Click to expand it.
Examples/python/fitting/ex02_FitBasics/MinimizerOptions.py
+
5
−
4
View file @
4500e670
...
@@ -79,7 +79,7 @@ def run_fitting():
...
@@ -79,7 +79,7 @@ def run_fitting():
# Uncomment one of the line below to adjust minimizer settings
# Uncomment one of the line below to adjust minimizer settings
# setting Minuit2 minimizer with Migrad algorithm, limiting number of iterations
# setting Minuit2 minimizer with Migrad algorithm, limiting number of iterations
# Minimization will try to respect MaxFunctionCalls value
and will stop around this value
# Minimization will try to respect MaxFunctionCalls value
# fit_suite.setMinimizer("Minuit2", "Migrad", "MaxFunctionCalls=100")
# fit_suite.setMinimizer("Minuit2", "Migrad", "MaxFunctionCalls=100")
# Setting two options at once.
# Setting two options at once.
...
@@ -92,14 +92,15 @@ def run_fitting():
...
@@ -92,14 +92,15 @@ def run_fitting():
# Setting Levenberg-Marquardt algorithm
# Setting Levenberg-Marquardt algorithm
# fit_suite.setMinimizer("GSLLMA")
# fit_suite.setMinimizer("GSLLMA")
# Setting Genetic algorithm
# Setting Genetic algorithm
.It requires all parameters
#
It requires all parameters
to be limited, so we recreate parameters with min and max defined
# to be limited, so we recreate parameters with min and max defined
# fit_suite.fitParameters().clear()
# fit_suite.fitParameters().clear()
# fit_suite.addFitParameter("*Cylinder/Height", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Cylinder/Height", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Cylinder/Radius", 6.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Cylinder/Radius", 6.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Prism3/Height", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Prism3/Height", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Prism3/BaseEdge", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Prism3/BaseEdge", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.setMinimizer("Genetic", "Default", "MaxIterations=2;PopSize=200;RandomSeed=1")
# fit_suite.setMinimizer("Genetic", "Default",
# "MaxIterations=2;PopSize=200;RandomSeed=1")
# running fit with default minimizer
# running fit with default minimizer
fit_suite
.
runFit
()
fit_suite
.
runFit
()
...
...
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