Skip to content

Commit

Permalink
Issue 27: Invalid escape sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
dokester committed Dec 9, 2024
1 parent acab599 commit ce3f285
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 46 deletions.
20 changes: 10 additions & 10 deletions BayesicFitting/source/DecisionTreeModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from .UniformPrior import UniformPrior

__author__ = "Do Kester"
__year__ = 2020
__year__ = 2024
__license__ = "GPL3"
__version__ = "2.5.3"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"

Expand All @@ -34,7 +34,7 @@
# *
# * The GPL3 license can be found at <http://www.gnu.org/licenses/>.
# *
# * 2019 - 2020 Do Kester
# * 2019 - 2024 Do Kester


class DecisionTreeModel( Modifiable, Dynamic, LinearModel ):
Expand All @@ -50,10 +50,10 @@ class DecisionTreeModel( Modifiable, Dynamic, LinearModel ):
Booleans that contain unknowns should be coded as categorial.
f( x:p ) = DTM
\left => DTM (or None)
\rite => DTM (or None)
\dimension
\split or \mask
|-> left => DTM (or None)
|-> rite => DTM (or None)
|-> dimension
|-> split or mask
The tree is searched left to right.
Expand Down Expand Up @@ -203,7 +203,7 @@ def __init__( self, ndim=1, depth=0, split=0.5, kdim=0, itypes=[0], modifiable=T
while True :
try :
child = next( gen )
except :
except Exception :
break
if child.itypes is not None :
del( child.itypes )
Expand Down Expand Up @@ -662,7 +662,7 @@ def check( self ) :
while kl < kbranch :
try :
child = next( gen )
except :
except Exception :
break
if not child.isLeaf() :
kl += 1
Expand Down Expand Up @@ -700,7 +700,7 @@ def count( self ) :
while True :
try :
child = next( gen )
except :
except Exception :
break

if child.isLeaf() :
Expand Down
8 changes: 4 additions & 4 deletions BayesicFitting/source/EtalonModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from .NonLinearModel import NonLinearModel

__author__ = "Do Kester"
__year__ = 2020
__year__ = 2024
__license__ = "GPL3"
__version__ = "2.6.0"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"

Expand All @@ -31,13 +31,13 @@
# * Science System (HCSS), also under GPL3.
# *
# * 2015 - 2014 Do Kester, SRON (Java code)
# * 2016 - 2020 Do Kester
# * 2016 - 2024 Do Kester

class EtalonModel( NonLinearModel ):
"""
Etalon Model.
f( x:p ) = p_0 / ( 1.0 + p_1 * sin^2( \pi p_2 x + p_3 ) )
f( x:p ) = p_0 / ( 1.0 + p_1 * sin^2( &pi; p_2 x + p_3 ) )
where
p_0 = amplitude
Expand Down
14 changes: 7 additions & 7 deletions BayesicFitting/source/MaxLikelihoodFitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from .Formatter import formatter as fmt

__author__ = "Do Kester"
__year__ = 2023
__year__ = 2024
__license__ = "GPL3"
__version__ = "3.1.0"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"

Expand All @@ -38,7 +38,7 @@
# * Science System (HCSS), also under GPL3.
# *
# * 2003 - 2014 Do Kester, SRON ( Java code )
# * 2016 - 2023 Do Kester
# * 2016 - 2024 Do Kester

class MaxLikelihoodFitter( IterativeFitter ):
"""
Expand Down Expand Up @@ -238,8 +238,8 @@ def func( self, par ):
"""
Return the function to be minimized.
In this case
.. math::
\chi^2 = \sum( D_i - F(x_i:p) )^2
chi^2 = sum( D_i - F(x_i:p) )^2
"""
param = self._outer.insertParameters( par, index=self._index )
Expand All @@ -256,8 +256,8 @@ def userdfunc( self, par ):
def dfunc( self, par ):
"""
Return the gradient of func to the parameters p.
.. math::
d\chi^2/dp = -2 \sum( D_i - F_i ) dF_i/dp
d chi^2/dp = -2 sum( D_i - F_i ) dF_i/dp
"""
param = self._outer.insertParameters( par, index=self._index )
res = numpy.subtract( self._outer.model.result( self._outer.xdata, param ), self._data )
Expand Down
6 changes: 3 additions & 3 deletions BayesicFitting/source/NeuralNetUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@


__author__ = "Do Kester"
__year__ = 2022
__year__ = 2024
__license__ = "GPL3"
__version__ = "3.0.0"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Alpha"

Expand Down Expand Up @@ -63,7 +63,7 @@ def pipe( self, dfdr, drdp ) :


class Connect( BaseNeuralNetworkUtilities ):
"""
r"""
Connects one layer to the next.
0 0 0 0 0 0 K inputs
Expand Down
8 changes: 4 additions & 4 deletions BayesicFitting/source/RobustShell.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from .kernels.Biweight import Biweight

__author__ = "Do Kester"
__year__ = 2023
__year__ = 2024
__license__ = "GPL3"
__version__ = "3.2.0"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"

Expand All @@ -31,7 +31,7 @@
# * Science System (HCSS), also under GPL3.
# *
# * 2008 - 2014 Do Kester, SRON (Java code)
# * 2017 - 2023 Do Kester
# * 2017 - 2024 Do Kester


class RobustShell( IterativeFitter ):
Expand All @@ -46,7 +46,7 @@ class RobustShell( IterativeFitter ):
downweighted. "Normal" points keep their weights, more or less.
Apart from methods specific to the robustification, RobustShell has a fit method
and little else from the Fitter family. Methods to get the :math:`\chi^2`,
and little else from the Fitter family. Methods to get chi^2,
the covariance matrix, the evidence, the noise scale etc. should be taken from
the embedded fitter.
Expand Down
6 changes: 3 additions & 3 deletions BayesicFitting/source/SampleList.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from .Sample import Sample

__author__ = "Do Kester"
__year__ = 2023
__year__ = 2024
__license__ = "GPL3"
__version__ = "3.2.0"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"

Expand Down Expand Up @@ -541,7 +541,7 @@ def average( self, xdata ):
# ===== MONTE CARLO ERRORS ===================================================
def monteCarloError( self, xdata ):
"""
Calculates 1-\sigma-confidence regions on the model given some inputs.
Calculates 1-sigma-confidence regions on the model given some inputs.
The model is run with the input for the parameters in each of the
samples. Appropiately weighted standard deviations are calculated
Expand Down
14 changes: 7 additions & 7 deletions BayesicFitting/source/SineDriftModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from .NonLinearModel import NonLinearModel

__author__ = "Do Kester"
__year__ = 2020
__year__ = 2024
__license__ = "GPL3"
__version__ = "2.5.3"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"

Expand Down Expand Up @@ -35,12 +35,12 @@
class SineDriftModel( NonLinearModel ):
"""
Sinusoidal Model with drifting frequency.
.. math::
f( x:p ) = p_1 * \cos( \phi ) + p_2 * sin( \phi )
\phi = 2 * \pi * x * ( p_0 + x * p_3 )
where :math:`p_0` = frequency, :math:`p_3` = is the drift in frequency,
:math:`p_1` = amplitude cosine and :math:`p_2` = amplitude sine.
f( x:p ) = p_1 * cos( phi ) + p_2 * sin( phi )
phi = 2 * pi * x * ( p_0 + x * p_3 )
where p_0 = frequency, p_3 = is the drift in frequency,
p_1 = amplitude cosine and p_2 = amplitude sine.
As always x = input.
The parameters are initialized at {1.0, 1.0, 1.0, 0.0}. It is a non-linear model.
Expand Down
8 changes: 4 additions & 4 deletions BayesicFitting/source/SineSplineModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from .SplinesModel import SplinesModel

__author__ = "Do Kester"
__year__ = 2020
__year__ = 2024
__license__ = "GPL3"
__version__ = "2.5.3"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"

Expand All @@ -26,13 +26,13 @@
# *
# * The GPL3 license can be found at <http://www.gnu.org/licenses/>.
# *
# * 2017 - 2020 Do Kester
# * 2017 - 2024 Do Kester

class SineSplineModel( LinearModel ):
"""
Sine of fixed frequency with splineslike amplitudes/phases.
f( x:p ) = SM0 \cos( 2 &pi; &omega; x ) + SM1 sin( 2 &pi; &omega; x )
f( x:p ) = SM0 cos( 2 &pi; &omega; x ) + SM1 sin( 2 &pi; &omega; x )
Where SM0 and SM1 are splines models with defined knots and order.
Expand Down
8 changes: 4 additions & 4 deletions BayesicFitting/source/SoftMaxModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from .NonLinearModel import NonLinearModel

__author__ = "Do Kester"
__year__ = 2022
__year__ = 2024
__license__ = "GPL3"
__version__ = "3.0.0"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"

Expand All @@ -31,11 +31,11 @@
# *
# * The GPL3 license can be found at <http://www.gnu.org/licenses/>.
# *
# * 2020 - 2022 Do Kester
# * 2020 - 2024 Do Kester


class SoftMaxModel( NonLinearModel ):
"""
r"""
Softmax Model is a Logistic model if the number of outputs is 1.
Otherwise it is generalization of the LogisticModel over multiple outputs
Expand Down

0 comments on commit ce3f285

Please sign in to comment.