phyzhangyang / easyscan_hep Goto Github PK
View Code? Open in Web Editor NEWA tool for connecting programs to scan the parameter space of physics models
Home Page: https://easyscanhep.hepforge.org
License: Apache License 2.0
A tool for connecting programs to scan the parameter space of physics models
Home Page: https://easyscanhep.hepforge.org
License: Apache License 2.0
目前用python调用其他程序有两种方式,subprocess和os
有些程序不用通过subprocess或者os调用。所以两种方式都要提供,默认使用subprocess(或os),然后在[scan]中添加一个选择。
目前输出变量里包含文件目录
既:如果保存文件,变量里就会有路径,这个是没有用的,要删掉
在图中直接反映出限制先后的样本点
在画图之前,判断要画图的数据是否是常数或者非数字,如果是,就跳过该图片并提醒用户
目前,如果其中一个程序无法正确运行,或者没有产生正确的输出文件,那么判定该点为非物理的点。
出现这种点时要在屏幕上提醒用户。
将来可以添加一个功能,让用户选择是该点为非物理的点,还是正常的点。这个可以放到V2中完成
如果保存两个相同名称的文件,后保存的文件会覆盖前者。
可以给添加一个选项,为文件名
运行外部软件时,删除对应的输出文件。原因是如果不删除,有可能该软件没有正确输出,也就是非物理点,但输出文件存在,就会被错误读取。
之前这个功能缺失,但是通过下面方法避免了
[program1]
Program name: susyhit-1.6
Execute command: rm susyhit_slha.out
./run
Command path: ../Externals/susyhit/
也就是当中的 rm susyhit_slha.out
目前输入模式中的line、position,是按照空格或者\t划分的。有些软件的输出中可能没有空格,而是用逗号划分的,所以要改为
如果有逗号按照逗号划分,没有逗号按照空格或者\t划分
使用未定义变量时提供合理的报错信息
需要在结果文件中记录了每一项的chi2,以便查看各自贡献的大小。
现行版本有bug
mcmc算法中,如果有大量的测试样本点超出参数范围,提醒用户参数范围可能设定不合理
Is there a preferred citation for this tool? There appears to be no arXiv link and I notice others have cited https://arxiv.org/abs/1612.02296 .
Is it best to do something similar to
[#] Y. Zhang and L. Shang, EasyScan HEP, July, 2016. [Online] Available at: http://easyscanhep.hepforge.org.
添加一种Input variable功能:
Input variable: mu, 1, Replace, ES_mu
m1, 1, Replace, ES_m1
c, 1, Calculate, "par['m1']^2"
实现方法:
ss="par['mh1']^2"
cc="c"
eval("par["+cc+"]="+ss)
不确定是不是”par“
使用pandas储存数据
在做dampe工作时,要求暗物质和传播子的质量差小于5个GeV。
根据这个具体的需求,对程序要求有相应的功能。
如果用户提供的bin是非整数,转化为整数
测试
目前程序基本没有注射,需要添加注释
这个可以放到V2中完成
因为ES不需要安装,但依赖一些库,所以在程序运行前,可以让ES先判断一下是否缺少库。这个可以放到V2中完成
This is a demonstration block of demostrate.ini used for executing ./bin/easyscan demonstrate.ini.
[scan parameter]
lambda, ...
Alambda, ...
[program]
Input parameters:
lambda,
Alambda,
If lambda is 2.0, it will lead to A2.0.
Therefore, this indicates a bug in Easyscan_HEP. But the solution now is that you could try,
[scan parameter]
lambda, ...
ALambda, ...
关于扫描时得到的非物理点(不论何种扫描方式都有可能遇到)
处理方式:
另外,
对于我们加入Bound,例如Bound: mh > 123 and mh < 125。
不满足Bound的点,计入“unboundphysical points”(另外一个输入文件)
如果某个程序的输入文件只有一行一列,那么会报错,问题在mainfun.py的559行
使用 Ackley function 作为例子展示结果
https://en.wikipedia.org/wiki/Ackley_function
例如
https://github.com/kthohr/optim
programX中的input参数,默认前面都有一个math,这样就不用特别说明了
(不确定,需要check)目前只有在multinest模式下随机数种子有用其他模式没有用
如果用户提供的ini文件中缺少一些块,比如[scan], 报错并提示
目前MCMC算法的屏幕输出比较好看,其他模式下的屏幕输出不好认,要改为和MCMC一样的屏幕输出。
有些地方应该判断是否出错,然后提醒用户。这个需要完善
比如 程序使用未定义量时要 报错
保存的输出文件与输出变量可能不一致。有些参数点不能通过所有实验限制,不会保存到输出文件中,但已经运行过的程序产生的文件已经保存下来了,这就导致了最后不一致。
我不确定目前的版本运行时必须在bin下还是在任意目录都可以。需要改为在任意目录下运行都可以
参数的先验概率可以设置为fixed,即固定为一个数或者一组数,比如
mu, fixed, 1000
或
mu, fixed, [100, 150, 1000]
目前版本中只有Replace可以用,其他的处在问题。
主要是目前版本会把table改为空格,导致有些软件无法读取输入文件。
The --resume method does not work for onepoint batch mode.
在每一个程序后面加一个可选的功能,比如起名叫"Limit"
[program2]
Program name: micromegas_4.3.5
Execute command: rm result.txt
./main data.par >log.txt
Command path: ../Externals/micromegas_4.3.5/spinX/
Input file: 1, ../Externals/micromegas_4.3.5/spinX/data.par
Input variable: ma, 1, Replace, ESma
lamda, 1, Replace, ESlamda
kappa, 1, Replace, ESkappa
Output file: 1, ../Externals/micromegas_4.3.5/spinX/result.txt
Output variable: omg, 1, Position, 1,1
Limit: Par['omg']<0.1199+0.012*2
Limit后面是一个可以运行的表达式,返回的值是true或者false。 如果是false的话就不往下运行了,这样可以节省运行时间。
比如现在在做的这个工作,这里的判断就可以写成 Par['mn1‘]<Par['stau1'] & Par['mn1']<Par['snu_tau']
高斯分布限制必要的参数定为3个,第四个参数默认值设为“对称”
目前constraint必须提供。但是对于一些扫描,constraint没有必要,要求用户随便设置一个不太好,还是改程序,把constraint改为可选的比较好
目前constraint中只能接受高斯,按照说明书,也应该可以接受其他形式。至少要能接受像higgssignal这样的输出,既输出直接就是chi^2 或者likelihood
SLHA输入模式下,被改变的行前面没有空格。这样的输入文件在SUSYHIT中无法使用
对参数x y 进行扫描,在program里面什么都不干,只是复制文件,保证输出文件都一样。
[program1]
Bound: x, y, lower, utils/bound_wk.in
相当于是在x y平面上加了一条排除线。可是通过画图x y 感觉不是很对。
需要修改program.py 程序891 /893两行
par[ii[0]] 改为 par[ii[1]]
感觉是将y值跟y的限制值做比较
print('"%s=%f" v.s. "%s=%f" compare to the %s limit "%s=%f" by interplotion in "Bound" for program %s'%(ii[0], par[ii[0]], ii[1], par[ii[1]], ii[2].lower(), ii[1], yinter, self._ProgName))
输出
"x=103.714929" v.s. "y=9952.170002" compare to the lower limit "y=103.714929" by interplotion in "Bound" for program test
所以感觉是【par[ii[1]]】跟【par[jj[4]] = yinter】 进行比较
test.ini文件:
[scan]
Result file name: first-scan
Scan method: random
Points number: 1000
Input parameters: y, Flat, -10000, 10000
x, log, 1, 10000
Random seed: 2
Interval of print: 100
[program1]
Program name: test
Execute command: cp out.wk out
Command path: utils/
Input file:
Input variable:
Output file: 1, utils/out
Output variable: mh1, 1 , SLHA, BLOCK, MASS, 25
Bound: x, y, lower, utils/bound_wk.in
[constraint]
Gaussian: mh1, 125.0, 2.0
[plot]
scatter: x, y
out.wk文件
BLOCK MASS
25 123
bound_wk.in文件
-100 -100
10000 10000
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.