My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 30 days

  • Dec 08, 2009
    issue 6 (Functions with a variable number of parameters) commented on by acbecker   -   Using your extremely useful classes described above, I did a quick test to see how minuit performed when using 256 parameters instead of 12. When minimizing something quadratic it found the correct minimum to machine precision (1e-14), with negligible impact on system memory, and taking ~5 min on a 3GHz computer. Minos() also found the correct uncertainties. When the exponent was larger than 2 it took far longer (45m), still used negligible memory, and found values that were within the correct ones by 0.1% at most (though the typical difference was an order of magnitude smaller). I'm not sure I entirely understand the minos() error estimates though. Overall it seems that Minuit2 can reasonably handle hundreds of parameters.
    Using your extremely useful classes described above, I did a quick test to see how minuit performed when using 256 parameters instead of 12. When minimizing something quadratic it found the correct minimum to machine precision (1e-14), with negligible impact on system memory, and taking ~5 min on a 3GHz computer. Minos() also found the correct uncertainties. When the exponent was larger than 2 it took far longer (45m), still used negligible memory, and found values that were within the correct ones by 0.1% at most (though the typical difference was an order of magnitude smaller). I'm not sure I entirely understand the minos() error estimates though. Overall it seems that Minuit2 can reasonably handle hundreds of parameters.
  • Dec 07, 2009
    issue 6 (Functions with a variable number of parameters) commented on by jpivarski   -   > I'd like to push back on this idea that "the underlying Minuit library probably > can't handle a very large number of parameters" since this is the second time its > been brought up here. Do you have any evidence for this? No, I don't have any evidence for where exactly it breaks down. (I'm expecting practical limitations, not programmatic ones. Of course everything has a practical limitation--- Minuit's limit is just lower than other, more specialized methods. I'd be very surpised if it can handle non-quadratic functions of a few hundred parameters or more.) I'm just thinking about how it works (run it with printMode on to see): it has to vary each parameter holding all others fixed, which means that the number of function calls scales exponentially in the number of parameters. That will quickly exhaust the CPU or memory of the computer you're working on. If a problem has a very large number of parameters, one tries to cast it as a linear problem and solve it by matrix inversion (polynomial-time in the number of parameters, if I remember right). Even that gets unwieldy fairly quickly (at a few thousand parameters or so), and then you have to start thinking about sparse matrix ideas, or about finding a solution to the problem without actually inverting the matrix (e.g the Millepede II algorithm in detector alignment). The largest number of free parameters that I've ever heard of people using a general non-linear minimization package for is "dozens", in Dalitz fits of 3-body decays. For more complicated QCD multi-resonance fitting (like glueball searches), people use something called "wavelet analysis"--- I'm not sure if that's a special technique, more specialized than simple function minimization. Somewhere in the Minuit documentaion there's a stern warning against using it in situations where performance is an issue. It's not meant to solve all minimization problems, it's just a convenient tool for the easy cases.
    > I'd like to push back on this idea that "the underlying Minuit library probably > can't handle a very large number of parameters" since this is the second time its > been brought up here. Do you have any evidence for this? No, I don't have any evidence for where exactly it breaks down. (I'm expecting practical limitations, not programmatic ones. Of course everything has a practical limitation--- Minuit's limit is just lower than other, more specialized methods. I'd be very surpised if it can handle non-quadratic functions of a few hundred parameters or more.) I'm just thinking about how it works (run it with printMode on to see): it has to vary each parameter holding all others fixed, which means that the number of function calls scales exponentially in the number of parameters. That will quickly exhaust the CPU or memory of the computer you're working on. If a problem has a very large number of parameters, one tries to cast it as a linear problem and solve it by matrix inversion (polynomial-time in the number of parameters, if I remember right). Even that gets unwieldy fairly quickly (at a few thousand parameters or so), and then you have to start thinking about sparse matrix ideas, or about finding a solution to the problem without actually inverting the matrix (e.g the Millepede II algorithm in detector alignment). The largest number of free parameters that I've ever heard of people using a general non-linear minimization package for is "dozens", in Dalitz fits of 3-body decays. For more complicated QCD multi-resonance fitting (like glueball searches), people use something called "wavelet analysis"--- I'm not sure if that's a special technique, more specialized than simple function minimization. Somewhere in the Minuit documentaion there's a stern warning against using it in situations where performance is an issue. It's not meant to solve all minimization problems, it's just a convenient tool for the easy cases.
  • Dec 07, 2009
    issue 6 (Functions with a variable number of parameters) commented on by acbecker   -   I'd like to push back on this idea that "the underlying Minuit library probably can't handle a very large number of parameters" since this is the second time its been brought up here. Do you have any evidence for this? Its been used in the particule physics community for many years and I have not heard of any such limitations, either practical or programmatical.
    I'd like to push back on this idea that "the underlying Minuit library probably can't handle a very large number of parameters" since this is the second time its been brought up here. Do you have any evidence for this? Its been used in the particule physics community for many years and I have not heard of any such limitations, either practical or programmatical.
  • Dec 07, 2009
    issue 6 (Functions with a variable number of parameters) commented on by jpivarski   -   Speaking of which, does the following do what you want? >>> import minuit >>> class fake_code: ... def __init__(self, n): ... self.co_argcount = n ... self.co_varnames = tuple(map(str, range(n))) ... >>> class fake_function: ... def __init__(self, n): ... self.n = n ... self.func_code = fake_code(n) ... def __call__(self, *args): ... output = 0. ... for arg in args: ... output += arg**2 ... return output ... >>> m = minuit.Minuit(fake_function(12)) >>> m.values {'11': 0.0, '10': 0.0, '1': 0.0, '0': 0.0, '3': 0.0, '2': 0.0, '5': 0.0, '4': 0.0, '7': 0.0, '6': 0.0, '9': 0.0, '8': 0.0} >>> for key in m.values.keys(): ... m.values[key] = float(key) ... >>> m.values {'11': 11.0, '10': 10.0, '1': 1.0, '0': 0.0, '3': 3.0, '2': 2.0, '5': 5.0, '4': 4.0, '7': 7.0, '6': 6.0, '9': 9.0, '8': 8.0} >>> m.migrad() >>> m.values {'11': 9.4557606189482613e-10, '10': 4.0116692012759358e-07, '1': 8.5257134685434721e-11, '0': 0.0, '3': 2.5834134831370648e-10, '2': 1.7180656897153312e-10, '5': 4.3015990769390555e-10, '4': 3.4491476341713678e-10, '7': 6.0199845108854788e-10, '6': 5.1673776368943436e-10, '9': 7.7510620144494169e-10, '8': 6.8855232626674479e-10} Perhaps we could include your wrapper package in the PyMinuit bundle, so that users would import minuit for the classic interface and import multiminuit for the arbitrary number of parameters version. Since multiminuit.py would be a pure python package, it could have more features. Everyone should keep in mind, however, that the underlying Minuit library probably can't hande a very large number of parameters.
    Speaking of which, does the following do what you want? >>> import minuit >>> class fake_code: ... def __init__(self, n): ... self.co_argcount = n ... self.co_varnames = tuple(map(str, range(n))) ... >>> class fake_function: ... def __init__(self, n): ... self.n = n ... self.func_code = fake_code(n) ... def __call__(self, *args): ... output = 0. ... for arg in args: ... output += arg**2 ... return output ... >>> m = minuit.Minuit(fake_function(12)) >>> m.values {'11': 0.0, '10': 0.0, '1': 0.0, '0': 0.0, '3': 0.0, '2': 0.0, '5': 0.0, '4': 0.0, '7': 0.0, '6': 0.0, '9': 0.0, '8': 0.0} >>> for key in m.values.keys(): ... m.values[key] = float(key) ... >>> m.values {'11': 11.0, '10': 10.0, '1': 1.0, '0': 0.0, '3': 3.0, '2': 2.0, '5': 5.0, '4': 4.0, '7': 7.0, '6': 6.0, '9': 9.0, '8': 8.0} >>> m.migrad() >>> m.values {'11': 9.4557606189482613e-10, '10': 4.0116692012759358e-07, '1': 8.5257134685434721e-11, '0': 0.0, '3': 2.5834134831370648e-10, '2': 1.7180656897153312e-10, '5': 4.3015990769390555e-10, '4': 3.4491476341713678e-10, '7': 6.0199845108854788e-10, '6': 5.1673776368943436e-10, '9': 7.7510620144494169e-10, '8': 6.8855232626674479e-10} Perhaps we could include your wrapper package in the PyMinuit bundle, so that users would import minuit for the classic interface and import multiminuit for the arbitrary number of parameters version. Since multiminuit.py would be a pure python package, it could have more features. Everyone should keep in mind, however, that the underlying Minuit library probably can't hande a very large number of parameters.
  • Dec 07, 2009
    issue 6 (Functions with a variable number of parameters) commented on by jpivarski   -   First answer: > Have you ever considered adding such an alternative way of constructing the pyminuit object? I hadn't considered it until you brought it up, but it could be good if the Minuit constructor would take a Python callable OR an instance of some Fcn class, defined in the Minuit package. That way, it would have the current convenience and also the flexibility you describe. I don't have the time to do that now, but if you're willing to make these updates to a copy of the code, I'll test them and post them as a new version. Second answer: If you just want to fool PyMinuit to get something that works, can't you make an object like the following? class fake_code: def __init__(self): self.co_argcount = 3 self.co_varnames = ("one", "two", "three") class fake_function: def __init__(self): self.func_code = fake_code() def __call__(self, one, two, three): return one**2 + two**2 + three**2 m = minuit.Minuit(fake_function()) The fake_function can have whatever other properties you want. It is a hacky bit of reverse engineering, but it gets the job done.
    First answer: > Have you ever considered adding such an alternative way of constructing the pyminuit object? I hadn't considered it until you brought it up, but it could be good if the Minuit constructor would take a Python callable OR an instance of some Fcn class, defined in the Minuit package. That way, it would have the current convenience and also the flexibility you describe. I don't have the time to do that now, but if you're willing to make these updates to a copy of the code, I'll test them and post them as a new version. Second answer: If you just want to fool PyMinuit to get something that works, can't you make an object like the following? class fake_code: def __init__(self): self.co_argcount = 3 self.co_varnames = ("one", "two", "three") class fake_function: def __init__(self): self.func_code = fake_code() def __call__(self, one, two, three): return one**2 + two**2 + three**2 m = minuit.Minuit(fake_function()) The fake_function can have whatever other properties you want. It is a hacky bit of reverse engineering, but it gets the job done.
  • Dec 07, 2009
    issue 6 (Functions with a variable number of parameters) commented on by abeardmore   -   I've been trying to write a general model fit wrapper to pyminuit, so that only the model function (which depends on the input params and xdata) has to be defined. But am finding it extremely limiting given that the pyminuit object can only be constructed given its reliance on establishing the fcn input parameters by its trickery with the fcn func_code attribute. I've tried implementing the lambda function trick inside my own class but I can't get it to work - it complains that "global function fcn" not found; eval seems to miss the point that my fcn is local, not global! So instead I've had to go through hoops to wrap up the fcn inside another class. It would be so much easier if pyminuit accepted a list of parameter names, or maybe a fcn object, which say stored the parameters internally as a dictionary, and then we just had to provide a method to return the required fit statistic - i.e. pretty much how the c++ version of minuit works. Have you ever considered adding such an alternative way of constructing the pyminuit object?
    I've been trying to write a general model fit wrapper to pyminuit, so that only the model function (which depends on the input params and xdata) has to be defined. But am finding it extremely limiting given that the pyminuit object can only be constructed given its reliance on establishing the fcn input parameters by its trickery with the fcn func_code attribute. I've tried implementing the lambda function trick inside my own class but I can't get it to work - it complains that "global function fcn" not found; eval seems to miss the point that my fcn is local, not global! So instead I've had to go through hoops to wrap up the fcn inside another class. It would be so much easier if pyminuit accepted a list of parameter names, or maybe a fcn object, which say stored the parameters internally as a dictionary, and then we just had to provide a method to return the required fit statistic - i.e. pretty much how the c++ version of minuit works. Have you ever considered adding such an alternative way of constructing the pyminuit object?
  • Dec 07, 2009
    issue 6 (Functions with a variable number of parameters) commented on by abeardmore   -   I've been trying to write a general model fit wrapper to pyminuit, so that only the model function (which depends on the input params and xdata) has to be defined. But am finding it extremely limiting given that the pyminuit object can only be constructed given its reliance on establishing the fcn input parameters by its trickery with the fcn func_code attribute. I've tried implementing the lambda function trick inside my own class but I can't get it to work - it complains that "global function fcn" not found; eval seems to miss the point that my fcn is local, not global! So instead I've had to go through hoops to wrap up the fcn inside another class. It would be so much easier if pyminuit accepted a fcn object, which say stored the parameters internally as a dictionary, and which just had to provide a method to return the required fit statistic - i.e. pretty much how the c++ version of minuit works. Have you ever considered adding such an alternative way of constructing the pyminuit object?
    I've been trying to write a general model fit wrapper to pyminuit, so that only the model function (which depends on the input params and xdata) has to be defined. But am finding it extremely limiting given that the pyminuit object can only be constructed given its reliance on establishing the fcn input parameters by its trickery with the fcn func_code attribute. I've tried implementing the lambda function trick inside my own class but I can't get it to work - it complains that "global function fcn" not found; eval seems to miss the point that my fcn is local, not global! So instead I've had to go through hoops to wrap up the fcn inside another class. It would be so much easier if pyminuit accepted a fcn object, which say stored the parameters internally as a dictionary, and which just had to provide a method to return the required fit statistic - i.e. pretty much how the c++ version of minuit works. Have you ever considered adding such an alternative way of constructing the pyminuit object?

Earlier this year

  • Oct 05, 2009
    issue 13 (use of setuptools instead of distutils) reported by brinsco   -   Hi, There is many good reason to pass to setuptools, like the ability to install your soft as egg, which helps administrator to have more than one version of your soft at the same time. Furthermore, as far as I understand, if you do this step, people will have the ability to install your soft by simply typing: easy_install pyminuit. -------------------------- To create an egg of your soft, I modified as follow your setup.py diff -u setup.py.old setup.py.new --- setup.py.old 2009-10-05 09:57:19.000000000 +0200 +++ setup.py.new 2009-10-05 10:12:11.000000000 +0200 @@ -18,7 +18,8 @@ print "Assuming Minuit directory is: %s" % minuitdir print "************************************************************************************************" -from distutils.core import setup, Extension +from distutils.core import Extension +from setuptools import setup import os, subprocess and I must create an lib directory under pyminuit then.. python setup.py bdist_egg easy_install dist/pyMinuit-1.1.1-py2.5-linux-x86_64.egg cEd
    Hi, There is many good reason to pass to setuptools, like the ability to install your soft as egg, which helps administrator to have more than one version of your soft at the same time. Furthermore, as far as I understand, if you do this step, people will have the ability to install your soft by simply typing: easy_install pyminuit. -------------------------- To create an egg of your soft, I modified as follow your setup.py diff -u setup.py.old setup.py.new --- setup.py.old 2009-10-05 09:57:19.000000000 +0200 +++ setup.py.new 2009-10-05 10:12:11.000000000 +0200 @@ -18,7 +18,8 @@ print "Assuming Minuit directory is: %s" % minuitdir print "************************************************************************************************" -from distutils.core import setup, Extension +from distutils.core import Extension +from setuptools import setup import os, subprocess and I must create an lib directory under pyminuit then.. python setup.py bdist_egg easy_install dist/pyMinuit-1.1.1-py2.5-linux-x86_64.egg cEd
  • Sep 10, 2009
    issue 12 (Installation problem - cygpath : command not found) commented on by jpivarski   -   I think the original Windows-installation test was in XP. Does anyone have Windows Vista, and can confirm this problem? Better yet, does anyone know how the installation instructions should be modified to apply to Vista?
    I think the original Windows-installation test was in XP. Does anyone have Windows Vista, and can confirm this problem? Better yet, does anyone know how the installation instructions should be modified to apply to Vista?
  • Sep 09, 2009
    issue 12 (Installation problem - cygpath : command not found) reported by youval   -   What steps will reproduce the problem? 1. I'm following the installation instruction. - I installed latest version of MinGW - Downloaded msysCORE-1.0.11-bin.tar.gz Jul 18 2009, unzipped it, put all content in C:\MSYS and add C:\MSYS\bin to windows PATH - Downloaded Minuit-1_7_9 and created C:\Minuit-1_7_9 2. run CMD and changed directory to C:\Minuit-1_7_9 - sh configure worked fine - make did not run well, it can't find cygpath is there any other Windows path that I need to setup? any idea how this can be fixed? What version of the product are you using? On what operating system? Vista 32 my python installation is done using pythonxy PATH info: %WinDir%\System32;%CommonProgramFiles%\Microsoft Shared\Windows Live; C:\Python25\gtk\bin;C:\Python25;C:\Python25\DLLs;C:\Python25\Scripts; C:\Python25\Lib\site-packages\PyQt4;C:\Python25\gnuplot\bin; C:\Python25\Lib\site-packages\vtk;C:\Program Files\pythonxy\console; C:\Program Files\pythonxy\mingw\bin;C:\msys\bin
    What steps will reproduce the problem? 1. I'm following the installation instruction. - I installed latest version of MinGW - Downloaded msysCORE-1.0.11-bin.tar.gz Jul 18 2009, unzipped it, put all content in C:\MSYS and add C:\MSYS\bin to windows PATH - Downloaded Minuit-1_7_9 and created C:\Minuit-1_7_9 2. run CMD and changed directory to C:\Minuit-1_7_9 - sh configure worked fine - make did not run well, it can't find cygpath is there any other Windows path that I need to setup? any idea how this can be fixed? What version of the product are you using? On what operating system? Vista 32 my python installation is done using pythonxy PATH info: %WinDir%\System32;%CommonProgramFiles%\Microsoft Shared\Windows Live; C:\Python25\gtk\bin;C:\Python25;C:\Python25\DLLs;C:\Python25\Scripts; C:\Python25\Lib\site-packages\PyQt4;C:\Python25\gnuplot\bin; C:\Python25\Lib\site-packages\vtk;C:\Program Files\pythonxy\console; C:\Program Files\pythonxy\mingw\bin;C:\msys\bin
  • Aug 30, 2009
    issue 11 (Calling Pyminuit inside a script) Status changed by jpivarski   -   Okay, thanks for letting me know!
    Status: Invalid
    Okay, thanks for letting me know!
    Status: Invalid
  • Aug 30, 2009
    issue 11 (Calling Pyminuit inside a script) commented on by jp...@yahoo.com   -   I recompiled again and now everything is working OK.
    I recompiled again and now everything is working OK.
  • Aug 27, 2009
    issue 11 (Calling Pyminuit inside a script) commented on by jpivarski   -   There is no intended or expected restriction to the command-line. I just tested it on Linux (2.6.24-24-generic, Ubuntu Hardy Heron distribution) and have no trouble running something in a script. Could someone else with a Mac please verify? Thanks, -- Jim
    There is no intended or expected restriction to the command-line. I just tested it on Linux (2.6.24-24-generic, Ubuntu Hardy Heron distribution) and have no trouble running something in a script. Could someone else with a Mac please verify? Thanks, -- Jim
  • Aug 27, 2009
    issue 11 (Calling Pyminuit inside a script) reported by jp...@yahoo.com   -   What steps will reproduce the problem? 1. Run a Python script (OK) with 2. Import minuit (OK) and 3.execute any minuit command (e.g. minuit.Minuit(something)) What is the expected output? What do you see instead? Expected: No errors. What Happens: "AttributeError: 'module' object has no attribute 'Minuit'" What version of the product are you using? On what operating system? Pyminuit 1.1.1 on Mac OS 10.5.8 Please provide any additional information below. Pyminuit works flawlessly in the Python prompt, but I cannot get it working inside a Python script. I seems the module minuit is imported without errors, but when I try to use minuit.Minuit() this error happens... Is there any reason why Pyminuit can not me used inside a script? Perhaps I messed up something during the installation and it only works on a Python prompt? Thanks, John
    What steps will reproduce the problem? 1. Run a Python script (OK) with 2. Import minuit (OK) and 3.execute any minuit command (e.g. minuit.Minuit(something)) What is the expected output? What do you see instead? Expected: No errors. What Happens: "AttributeError: 'module' object has no attribute 'Minuit'" What version of the product are you using? On what operating system? Pyminuit 1.1.1 on Mac OS 10.5.8 Please provide any additional information below. Pyminuit works flawlessly in the Python prompt, but I cannot get it working inside a Python script. I seems the module minuit is imported without errors, but when I try to use minuit.Minuit() this error happens... Is there any reason why Pyminuit can not me used inside a script? Perhaps I messed up something during the installation and it only works on a Python prompt? Thanks, John
  • Apr 27, 2009
    issue 8 (MnUserTransformation.cpp:30: error: 'sprintf' is not a membe...) Status changed by jpivarski   -   Actually, that's a good point. Up to now, I haven't made any modifications to the Minuit pacakge itself, but it would do the world good to get rid of its verbose print-outs and apply the known correction above. I remember having to make the above comment in a rush for some unrelated reason...
    Status: Started
    Actually, that's a good point. Up to now, I haven't made any modifications to the Minuit pacakge itself, but it would do the world good to get rid of its verbose print-outs and apply the known correction above. I remember having to make the above comment in a rush for some unrelated reason...
    Status: Started
  • Apr 20, 2009
    issue 8 (MnUserTransformation.cpp:30: error: 'sprintf' is not a membe...) commented on by henning.osholm   -   May I ask why this one is got the status "Wont fix"? Does it make the compilation problematic on other systems?
    May I ask why this one is got the status "Wont fix"? Does it make the compilation problematic on other systems?
  • Apr 07, 2009
    issue 6 (Functions with a variable number of parameters) commented on by jpivarski   -   This is probably a limitation in Python's lambda command. (I haven't experimented, but I suspect that a function defined by "def" would not have this limitation.) Maybe you could use "exec" or even "execfile" to build the function with string operations, then evaluate it to make it real. But on the other hand... Can Minuit even minimize functions with more than 256 parameters? You guys are troubling my notions of what Minuit is for and what it can do. It's a general non-linear minimizer, so the number of function evaluations needed to find the minimum grows as a steep polynomial with the number of free parameters. If your problem is linear or quadratic, perhaps linear programming or an analytic fit would make the most sense. With a very large number of dimensions, perhaps a Monte Carlo method would be the most useful, or Monte Carlo to find an approximately quadratic regieme, and then analytic, or find the few parameters that matter and ask Minuit to minimize those. 256 parameters, sheesh!
    This is probably a limitation in Python's lambda command. (I haven't experimented, but I suspect that a function defined by "def" would not have this limitation.) Maybe you could use "exec" or even "execfile" to build the function with string operations, then evaluate it to make it real. But on the other hand... Can Minuit even minimize functions with more than 256 parameters? You guys are troubling my notions of what Minuit is for and what it can do. It's a general non-linear minimizer, so the number of function evaluations needed to find the minimum grows as a steep polynomial with the number of free parameters. If your problem is linear or quadratic, perhaps linear programming or an analytic fit would make the most sense. With a very large number of dimensions, perhaps a Monte Carlo method would be the most useful, or Monte Carlo to find an approximately quadratic regieme, and then analytic, or find the few parameters that matter and ask Minuit to minimize those. 256 parameters, sheesh!
  • Apr 07, 2009
    issue 6 (Functions with a variable number of parameters) commented on by acbecker   -   Hi - What is the appropriate solution when argument_list contains more than 255 variables? The code below args = ','.join( ['p%d' % (x) for x in range(256)] ) m = minuit2.Minuit2(eval('lambda %s: fcn(%s)' % (args, args))) returns the error Traceback (most recent call last): ... m = minuit2.Minuit2(eval('lambda %s: fcn(%s)' % (args, args))) File "<string>", line 1 SyntaxError: more than 255 arguments Thanks
    Hi - What is the appropriate solution when argument_list contains more than 255 variables? The code below args = ','.join( ['p%d' % (x) for x in range(256)] ) m = minuit2.Minuit2(eval('lambda %s: fcn(%s)' % (args, args))) returns the error Traceback (most recent call last): ... m = minuit2.Minuit2(eval('lambda %s: fcn(%s)' % (args, args))) File "<string>", line 1 SyntaxError: more than 255 arguments Thanks
  • Jan 15, 2009
    issue 10 (Windows Install Problem) reported by jwallis42   -   What steps will reproduce the problem? 1. sh configure 2. make 3. What is the expected output? files found. What do you see instead? $ make make all-recursive make[1]: Entering directory `/d/software/minuit/Minuit-1_7_9' Making all in Minuit make[2]: Entering directory `/d/software/minuit/Minuit-1_7_9/Minuit' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/d/software/minuit/Minuit-1_7_9/Minuit' Making all in src make[2]: Entering directory `/d/software/minuit/Minuit-1_7_9/src' Makefile:356: .deps/AnalyticalGradientCalculator.Plo: No such file or directory Makefile:357: .deps/BasicMinimumError.Plo: No such file or directory What version of the product are you using? On what operating system? Minuit-1_7_9 MinGW-5.1.4.exe msysCORE-1.0.11-20080826.tar.gz python-2.6.1.msi pyminuit-1.1.0.zip XP Please provide any additional information below. jwallis42@gmail.com
    What steps will reproduce the problem? 1. sh configure 2. make 3. What is the expected output? files found. What do you see instead? $ make make all-recursive make[1]: Entering directory `/d/software/minuit/Minuit-1_7_9' Making all in Minuit make[2]: Entering directory `/d/software/minuit/Minuit-1_7_9/Minuit' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/d/software/minuit/Minuit-1_7_9/Minuit' Making all in src make[2]: Entering directory `/d/software/minuit/Minuit-1_7_9/src' Makefile:356: .deps/AnalyticalGradientCalculator.Plo: No such file or directory Makefile:357: .deps/BasicMinimumError.Plo: No such file or directory What version of the product are you using? On what operating system? Minuit-1_7_9 MinGW-5.1.4.exe msysCORE-1.0.11-20080826.tar.gz python-2.6.1.msi pyminuit-1.1.0.zip XP Please provide any additional information below. jwallis42@gmail.com

Older

  • Nov 10, 2008
    issue 9 (Minimize Callable classes) commented on by jpivarski   -   That's a use-case I hadn't thought of. Classes as objective functions would allow you to store information in the class members without resorting to global variables: a different kind of function. Of course, the only truly new ability that would give you would be the ability for functions to have hystiresis, to depend on its history in addition to the parameters, which would surely break the minimization procedure. (Although I guess it would also be useful for caching partial results if that's needed for speed, as long as you're careful not to accidentially introduce hysteresis. The first application on PyMinuit in my thesis cached partial results for a function defined by convolution, though it did so with global variables.) After all of that, I think I'm going to have to say that PyMinuit won't be able to accept callable objects in place of functions. The func_code object is a Python semi-internal which is specific to functions, and PyMinuit uses it to learn about the names and number of parameters and their starting values without explicit prompts from the user. It could be modified to look at obj.__call__ when obj isn't a function, but then it would have to know to always ignore the first element. "self" is not an optimizable, real-valued parameter! -- Jim
    That's a use-case I hadn't thought of. Classes as objective functions would allow you to store information in the class members without resorting to global variables: a different kind of function. Of course, the only truly new ability that would give you would be the ability for functions to have hystiresis, to depend on its history in addition to the parameters, which would surely break the minimization procedure. (Although I guess it would also be useful for caching partial results if that's needed for speed, as long as you're careful not to accidentially introduce hysteresis. The first application on PyMinuit in my thesis cached partial results for a function defined by convolution, though it did so with global variables.) After all of that, I think I'm going to have to say that PyMinuit won't be able to accept callable objects in place of functions. The func_code object is a Python semi-internal which is specific to functions, and PyMinuit uses it to learn about the names and number of parameters and their starting values without explicit prompts from the user. It could be modified to look at obj.__call__ when obj isn't a function, but then it would have to know to always ignore the first element. "self" is not an optimizable, real-valued parameter! -- Jim
  • Nov 10, 2008
    issue 9 (Minimize Callable classes) reported by john.pretz   -   I wonder if it could be possible to allow callable classes. I tried this code and get the error: $ python fit.py Traceback (most recent call last): File "fit.py", line 18, in ? m = minuit.Minuit(f,x=10,y=10) AttributeError: func instance has no attribute 'func_code' class func: def __init__(self,x0,y0): self.x0 = x0 self.y0 = y0 self.co_varnames = ("x","y") def __call__(self,x,y): return (x - self.x0) ** 2 + (y - self.y0) ** 2 import minuit f = func(2,3) m = minuit.Minuit(f,x=10,y=10)
    I wonder if it could be possible to allow callable classes. I tried this code and get the error: $ python fit.py Traceback (most recent call last): File "fit.py", line 18, in ? m = minuit.Minuit(f,x=10,y=10) AttributeError: func instance has no attribute 'func_code' class func: def __init__(self,x0,y0): self.x0 = x0 self.y0 = y0 self.co_varnames = ("x","y") def __call__(self,x,y): return (x - self.x0) ** 2 + (y - self.y0) ** 2 import minuit f = func(2,3) m = minuit.Minuit(f,x=10,y=10)
  • Nov 09, 2008
    issue 8 (MnUserTransformation.cpp:30: error: 'sprintf' is not a membe...) commented on by davide.orsi1   -   Same problem on Kubuntu 8.10, fix worked. Thanks!!!!
    Same problem on Kubuntu 8.10, fix worked. Thanks!!!!
  • Nov 03, 2008
    issue 8 (MnUserTransformation.cpp:30: error: 'sprintf' is not a membe...) Status changed by jpivarski   -   This is an environment-specific issue, which does not occur on all systems. Thanks James for also providing a solution, I hope others find it helpful!
    Status: WontFix
    This is an environment-specific issue, which does not occur on all systems. Thanks James for also providing a solution, I hope others find it helpful!
    Status: WontFix
  • Nov 03, 2008
    issue 8 (MnUserTransformation.cpp:30: error: 'sprintf' is not a membe...) reported by jamesrledoux   -   Running make I get the following error: MnUserTransformation.cpp:30: error: 'sprintf' is not a member of 'std' This was quickly fixed by adding the line: #include <cstdio> to right below '#include <algorithm>' in the src/MnUserTransformation.cpp What version of the product are you using? On what operating system? I am running ubuntu 8.10 (64 bit) with gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11).
    Running make I get the following error: MnUserTransformation.cpp:30: error: 'sprintf' is not a member of 'std' This was quickly fixed by adding the line: #include <cstdio> to right below '#include <algorithm>' in the src/MnUserTransformation.cpp What version of the product are you using? On what operating system? I am running ubuntu 8.10 (64 bit) with gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11).
  • Oct 10, 2008
    issue 7 (setup.py for pyminuit in windows gives an error message: inv...) commented on by duducouto   -   The version problem had to do with gcc. I removed mingw32 from the command line and it works. The only testing I did was to import minuit within python and that show no errors. This time it picked up the gcc version I had installed (gcc 3.4.4) instead of mingw32 In summary, installation in windows worked with this combination python 2.5 pyminuit-1.1.1 Minuit-1-7-9 Windows NT gcc 3.4.4 and the following command python setup.py install build --with-minuit=/cygdrive/c/Minuit-1_7_9 --Eduardo
    The version problem had to do with gcc. I removed mingw32 from the command line and it works. The only testing I did was to import minuit within python and that show no errors. This time it picked up the gcc version I had installed (gcc 3.4.4) instead of mingw32 In summary, installation in windows worked with this combination python 2.5 pyminuit-1.1.1 Minuit-1-7-9 Windows NT gcc 3.4.4 and the following command python setup.py install build --with-minuit=/cygdrive/c/Minuit-1_7_9 --Eduardo
  • Oct 10, 2008
    issue 7 (setup.py for pyminuit in windows gives an error message: inv...) commented on by jpivarski   -   I know that some people have gotten this to work on Windows (I don't have a test-computer for this). If one of those people is reading this, could you please let me know what versions you're using (of Python, PyMinuit, and Windows), so that we can narrow this down to a specific version and maybe someone can find the problem and fix it? It looks like a problem in Windows Python 2.5's distutils package, but that would affect a lot of things beyond PyMinuit. -- Jim
    I know that some people have gotten this to work on Windows (I don't have a test-computer for this). If one of those people is reading this, could you please let me know what versions you're using (of Python, PyMinuit, and Windows), so that we can narrow this down to a specific version and maybe someone can find the problem and fix it? It looks like a problem in Windows Python 2.5's distutils package, but that would affect a lot of things beyond PyMinuit. -- Jim
  • Oct 10, 2008
    issue 7 (setup.py for pyminuit in windows gives an error message: inv...) reported by duducouto   -   What steps will reproduce the problem? 1. cd /pyminuit-1.1.1/pyminuit 2. python setup.py install build -c mingw32 --with-minuit=/cygdrive/c/Minuit-1_7_9 3. What is the expected output? What do you see instead? not sure what to expect but see error message below ValueError:invalid version number '2.18.50.200080625' it points to the script version.py in distutils in python25 What version of the product are you using? On what operating system? python 2.5 pyminuit-1.1.1 Minuit-1-7-9 Windows NT Please provide any additional information below.
    What steps will reproduce the problem? 1. cd /pyminuit-1.1.1/pyminuit 2. python setup.py install build -c mingw32 --with-minuit=/cygdrive/c/Minuit-1_7_9 3. What is the expected output? What do you see instead? not sure what to expect but see error message below ValueError:invalid version number '2.18.50.200080625' it points to the script version.py in distutils in python25 What version of the product are you using? On what operating system? python 2.5 pyminuit-1.1.1 Minuit-1-7-9 Windows NT Please provide any additional information below.
  • Sep 21, 2008
    issue 1 (migrad() ignores limits???) Status changed by jpivarski   -   Well, when I tested it before, I got the correct behavior, but I've been getting more comments about limits not working, so it must be something that depends on the FCN somehow. Thanks, Jo, for the bug-fix! I've made a new version: 1.1.1. (Still works for me, so I have no objection.) -- Jim
    Status: Fixed
    Well, when I tested it before, I got the correct behavior, but I've been getting more comments about limits not working, so it must be something that depends on the FCN somehow. Thanks, Jo, for the bug-fix! I've made a new version: 1.1.1. (Still works for me, so I have no objection.) -- Jim
    Status: Fixed
  • Sep 19, 2008
    issue 1 (migrad() ignores limits???) commented on by jo.gregori   -   Hi there! first of all Jim thanks for your work and that you made it available! I like it a lot. I have fixed that bug in the intermediate file: self->upar->removeLimits(i); self->upar->setLimits(i, PyFloat_AsDouble(PyTuple_GetItem(limit, 0)), PyFloat_AsDouble(PyTuple_GetItem(limit, 1)) ); //original lines: //self->upar->setLowerLimit(i, PyFloat_AsDouble(PyTuple_GetItem(limit, 0))); //self->upar->setUpperLimit(i, PyFloat_AsDouble(PyTuple_GetItem(limit, 1))); seems by calling "setUpperLimit", the lower limit is deleted again. Cheers Johannes.
    Hi there! first of all Jim thanks for your work and that you made it available! I like it a lot. I have fixed that bug in the intermediate file: self->upar->removeLimits(i); self->upar->setLimits(i, PyFloat_AsDouble(PyTuple_GetItem(limit, 0)), PyFloat_AsDouble(PyTuple_GetItem(limit, 1)) ); //original lines: //self->upar->setLowerLimit(i, PyFloat_AsDouble(PyTuple_GetItem(limit, 0))); //self->upar->setUpperLimit(i, PyFloat_AsDouble(PyTuple_GetItem(limit, 1))); seems by calling "setUpperLimit", the lower limit is deleted again. Cheers Johannes.
 
Hosted by Google Code