All Projects → paulknysh → sym

paulknysh / sym

Licence: MIT license
A Mathematica package for generating symbolic models from data

Programming Languages

Mathematica
289 projects

Projects that are alternatives of or similar to sym

Codegen
A model-view based code generator written in Java
Stars: ✭ 36 (-21.74%)
Mutual labels:  model, generation
modelina
Library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents.
Stars: ✭ 55 (+19.57%)
Mutual labels:  model, generation
Flooks
🍸 A state manager for React Hooks
Stars: ✭ 201 (+336.96%)
Mutual labels:  model
GroundGrowing
Open Source Unity3d Planetary Terrain Editor Extension with incremental background updates via multithreading
Stars: ✭ 66 (+43.48%)
Mutual labels:  generation
Whc model
iOS平台高效转换引擎json->model,model->json,model->Dictionary,支持模型类继承其他模型类,支持指定路径转换,不区分json的key和模型属性名称大小写,自动处理json中null
Stars: ✭ 244 (+430.43%)
Mutual labels:  model
Lol Model Viewer
League of legends model and animation viewer based on WebGL. https://tengge1.github.io/lol-model-viewer
Stars: ✭ 211 (+358.7%)
Mutual labels:  model
MaskRCNN-Modanet-Fashion-Segmentation-and-Classification
Using modanet fashion dataset, the clothes images were classified under 5 season (summer,winter,spring,autumn,all).
Stars: ✭ 55 (+19.57%)
Mutual labels:  model
Trilogy
TypeScript SQLite layer with support for both native C++ & pure JavaScript drivers.
Stars: ✭ 195 (+323.91%)
Mutual labels:  model
createml-playgrounds
Create ML playgrounds for building machine learning models. For developers and data scientists.
Stars: ✭ 82 (+78.26%)
Mutual labels:  model
Model
Angular Model - Simple state management with minimalist API, one way data flow, multiple model support and immutable data exposed as RxJS Observable.
Stars: ✭ 242 (+426.09%)
Mutual labels:  model
image-gen-api
An API To manupulate Images
Stars: ✭ 14 (-69.57%)
Mutual labels:  generation
Live2dmodel
页面上加载的模型
Stars: ✭ 241 (+423.91%)
Mutual labels:  model
Baby
Create models from a JSON file, even a Baby can do it.
Stars: ✭ 214 (+365.22%)
Mutual labels:  model
GPT2-Telegram-Chatbot
GPT-2 Telegram Chat bot
Stars: ✭ 67 (+45.65%)
Mutual labels:  generation
Model
The base model traits of Esensi
Stars: ✭ 203 (+341.3%)
Mutual labels:  model
menthor-editor
Menthor Editor
Stars: ✭ 31 (-32.61%)
Mutual labels:  model
Mathmodel
研究生数学建模,本科生数学建模、数学建模竞赛优秀论文,数学建模算法,LaTeX论文模板,算法思维导图,参考书籍,Matlab软件教程,PPT
Stars: ✭ 3,834 (+8234.78%)
Mutual labels:  model
Django Colorfield
color field for django models with a nice color-picker in the admin. 🎨
Stars: ✭ 238 (+417.39%)
Mutual labels:  model
cti-stix-generator
OASIS Cyber Threat Intelligence (CTI) TC: A tool for generating STIX content for prototyping and testing. https://github.com/oasis-open/cti-stix-generator
Stars: ✭ 27 (-41.3%)
Mutual labels:  generation
eloquent-filemaker
A Model extension and Eloquent driver for Laravel connecting to FileMaker through the Data API
Stars: ✭ 38 (-17.39%)
Mutual labels:  model

sym: A Mathematica package for generating symbolic models from data

What is this?

A Monte Carlo search for a symbolic model that fits given data. User needs to provide an error function (of how well a model fits the data) and some basic building blocks (math operations, variables, constants), from which random models will be generated. Procedure scales on multicore CPUs by running several independent Monte Carlo loops in parallel and subsequently accumulating obtained results.

Demo

A dummy case of fitting sqrt() function using the following - unary operations: log(abs()), sin(), cos(); binary operations: +, -, *, /; constants: e, pi; variables: x.

Evaluation time is set to 10 minutes. Total number of generated models is ~ 6 000 000 (on quad-core intel i7 desktop).

How do I represent my error function?

A Mathematica function/module called Error needs to be defined:

Error[model_]:=...

where model is a symbolic expression. Error has to return a non-negative value that is being minimized.

How do I run the procedure?

A template is presented below:

Get["...\\my_folder\\sym.m"] (*path to sym.m*)

data=Table[{i, Sqrt[i]}, {i, 0, 1, 0.1}]; (*given data*)
Error[model_]:=Mean@Table[Abs[data[[i,2]]-model/.{x->data[[i,1]]}],{i,Length[data]}] (*mean deviation*)

time=60*10; (*time in seconds for running the procedure*)
ncores=4; (*number of cores to be used*)
uops={Log[Abs[#]]&,Sin[#]&,Cos[#]&}; (*list of unary operations*)
bops={Plus,Subtract,Times,Divide}; (*list of binary operations*)
vars={x,E,Pi}; (*all free variables that are used in Error[], and also constants if needed*)
nops=10; (*max number of operations used for constructing model*)

output=Search[time,ncores,uops,bops,vars,nops]; (*runs procedure*)
output[[1]]//TableForm (*returns accumulated list of best 100 models with corresponding error values*)
output[[2]] (*returns total number of iterations*)

Important:

  • Some operations must be protected. Applying Exp and Power on large/small enough numbers, especially when randomly generated model contains nestings like Exp[Exp[Exp[...]]], can cause severe memory leaks. Therefore, arguments of these functions need to be protected by Clip (cuts off large/small values). For instance, instead of listing Exp in uops user needs to list Exp[Clip[#,{10^-6,10^2},{0,Infinity}]]&. Also, it's better to use Log[Abs[#]]& and Sqrt[Abs[#]]& instead of just Log and Sqrt to avoid nasty complex numbers. Arithmetic operations (Plus, Subtract, Times, Divide) are safe, dividing by 0 is OK. When adding new operations, make sure they are safe, otherwise use proper safety!

Author

Paul Knysh

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].