jonnyhyman / convex_symbolic Goto Github PK
View Code? Open in Web Editor NEWPython symbolic canonicalizer and C code generator for embedding convex optimization problems.
License: GNU General Public License v3.0
Python symbolic canonicalizer and C code generator for embedding convex optimization problems.
License: GNU General Public License v3.0
The performance and utility of the C templates can definitely be improved. If you have ideas discuss them here!
In trying to transpose an atoms.smul instance, I ran into a strange error during the deepcopy phase.
File "c:\users\__jonny__\dropbox\compute\convexoptimization\convex_symbolic\cvx_sym\symbolic.py", line 354, in T
transpose = copy.deepcopy(self)
File "C:\Python36-64\lib\copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "C:\Python36-64\lib\copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "C:\Python36-64\lib\copy.py", line 150, in deepcopy
y = copier(x, memo)
File "C:\Python36-64\lib\copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Python36-64\lib\copy.py", line 150, in deepcopy
y = copier(x, memo)
File "C:\Python36-64\lib\copy.py", line 215, in _deepcopy_list
append(deepcopy(a, memo))
File "C:\Python36-64\lib\copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "C:\Python36-64\lib\copy.py", line 274, in _reconstruct
y = func(*args)
File "C:\Python36-64\lib\copyreg.py", line 88, in __newobj__
return cls.__new__(cls, *args)
File "c:\users\__jonny__\dropbox\compute\convexoptimization\convex_symbolic\cvx_sym\operations\atoms\muls.py", line 39, in __new__
return sym.Constant(args[0].value * args[1].value)
IndexError: tuple index out of range
It appears in doing the deepcopy, the new method was called on the smul and misinterpreted the args as constants.
For now, transpose only symbols directly. In the future, will need to implement a transpose method for functions.
Hello there,
I try to cite Convex_Symbolic in my paper, in follow way
@Manual{Convex_Symbolic ,
author = "Jonny Hyman",
title = "Python symbolic canonicalizer and C code generator for embedding convex optimization problems",
year = 2018,
url = "https://github.com/jonnyhyman/Convex_Symbolic"
}
Is this ok?
Due to ordered dicts in 3.6. Will not be fixed for the forseeable future as we are relying on it.
Index by subscript not yet supported (ie. must use Symbol[i,j] not Symbol[i][j])
Creating a symbol or vector gives it a shape of (N,1), instead of what appears to be the standard (1,N). It assists in clarity for matrix multiplication and "mathematical standards" to have the latter format, but the former format appears to be favored by numpy and cvxpy
In smith form, we factor out vectors equal to aux variables (ie. A = <A0, A1, A2> becomes A = sym0 and sym0[0] = A0, sym0[1] = A0, sym0[2] = A2).
We do this because otherwise placing functions within vectors can be missed by the canonicalization process.
By doing this however, we usually introduced masses of totally unnecessary auxiliary variables.
When doing code generation, scalars, whose conventional shape is (1,1), end up being defined as arrays like : scalar[1][1];
Must catch if scalar and not give dimensions in the problem.h file
Add a setup.py to streamline installation
X[-1] does not access last element as it should
Templates should define an interface for retrieving variables. Ideally, cache indices prior to solution and retrieve based on known indices
For problems with more than about 500 variables (primal + auxiliary), matrix stuffing takes far longer than it should, chiefly due to the "get coefficients" algorithms. We should probably cache all coefficients in the expression tree, and access that cache rather than constantly recomputing every coefficient for every variable every time we run "get coefficients"
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.