packages feed

srtree 2.0.1.4 → 2.0.1.5

raw patch · 5 files changed

+20/−12 lines, 5 filesdep ~optparse-applicativePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: optparse-applicative

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,5 +1,10 @@ # Changelog for srtree +## 2.0.1.5++- Fix `refit` to only replace the fitness if it improves the fitness +- Fix `paretoFront` + ## 2.0.1.4  - Added `loadTrainingOnly`, `splitData`, and `loadX` to `Data.SRTree.Datasets`
README.md view
@@ -7,9 +7,9 @@ - [srsimplify](apps/srsimplify/README.md): a parser and simplification tool supporting the output of many popular SR algorithms. - [srtools](apps/srtools/README.md): a tool that can be used to evaluate symbolic regression expressions and create nice reports with confidence intervals.  - [tinygp](apps/tinygp/README.md): a simple GP implementation based on tinyGP.-- [rEGGression](apps/rEGGression/README.md): nonlinear regression models exploration and query system with e-graphs (egg).-- [symregg](apps/symregg/README.md): Equality graph Assisted Search Technique for Equation Recovery.-- [eggp](apps/eggp/README.md): E-graph Genetic Programming.+- [rEGGression](https://github.com/folivetti/reggression/blob/main/README.md): nonlinear regression models exploration and query system with e-graphs (egg).+- [symregg](https://github.com/folivetti/symregg/blob/main/README.md): Equality graph Assisted Search Technique for Equation Recovery.+- [eggp](https://github.com/folivetti/eggp/blob/main/README.md): E-graph Genetic Programming.  ## SRTree 
src/Algorithm/EqSat.hs view
@@ -122,7 +122,7 @@                        -- step 1: match the rules                        let matchSch        = matchWithScheduler it                            matchAll        = zipWithM matchSch [0..]-                           (rules, sch') = runState (matchAll rules') sch+                           (rules, sch')   = runState (matchAll rules') sch                         -- step 2: apply matches and rebuild                        matches <- mapM (\rule -> map (rule,) <$> match (source rule)) $ concat rules
src/Algorithm/EqSat/SearchSR.hs view
@@ -145,7 +145,10 @@ refit fitFun ec = do   t <- getBestExpr ec   (f, p) <- fitFun t-  insertFitness ec f p+  mf <- getFitness ec+  case mf of+    Nothing -> insertFitness ec f p+    Just f' -> when (f > f') $ insertFitness ec f p  --printBest :: (Int -> EClassId -> RndEGraph ()) -> RndEGraph () printBest fitFun printExprFun = do@@ -166,14 +169,14 @@             if not (null ecList)                 then do let (ec, mf) = head ecList                             f' = fromJust mf-                            improved = f' > f && (not . isNaN) f' && (not . isInfinite) f'+                            improved = f' >= f && (not . isNaN) f' && (not . isInfinite) f'                         ec' <- canonical ec                         if improved                                 then do refit fitFun ec'                                         t <- printExprFun ix ec'-                                        ts <- go (n+1) (ix + if improved then 1 else 0) (max f (fromJust mf))+                                        ts <- go (n+1) (ix + if improved then 1 else 0) (max f f')                                         pure (t:ts)-                                else go (n+1) (ix + if improved then 1 else 0) (max f (fromJust mf))+                                else go (n+1) (ix + if improved then 1 else 0) (max f f')                 else go (n+1) ix f  evaluateUnevaluated fitFun = do
srtree.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           srtree-version:        2.0.1.4+version:        2.0.1.5 synopsis:       A general library to work with Symbolic Regression expression trees. description:    A Symbolic Regression Tree data structure to work with mathematical expressions with support to first order derivative and simplification; category:       Math, Data, Data Structures@@ -111,7 +111,7 @@     , list-shuffle >=1.0.0.1 && <1.1     , massiv >=1.0.4.1 && <1.1     , mtl >=2.2 && <2.4-    , optparse-applicative >=0.17 && <0.19+    , optparse-applicative >=0.18 && <0.20     , random >=1.2 && <1.4     , scheduler >=2.0.0.1 && <3     , split >=0.2.5 && <0.3@@ -151,7 +151,7 @@     , list-shuffle >=1.0.0.1 && <1.1     , massiv >=1.0.4.1 && <1.1     , mtl >=2.2 && <2.4-    , optparse-applicative >=0.17 && <0.19+    , optparse-applicative >=0.18 && <0.20     , random >=1.2 && <1.4     , scheduler >=2.0.0.1 && <3     , split >=0.2.5 && <0.3@@ -191,7 +191,7 @@     , list-shuffle >=1.0.0.1 && <1.1     , massiv >=1.0.4.1 && <1.1     , mtl >=2.2 && <2.4-    , optparse-applicative >=0.17 && <0.19+    , optparse-applicative >=0.18 && <0.20     , random >=1.2 && <1.4     , scheduler >=2.0.0.1 && <3     , split >=0.2.5 && <0.3