Editing User:Ozzy

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 77: Line 77:


== Y: Your task ==
== Y: Your task ==
* Did you select a task from our list of proposals and ideas?
* Did you select a task from our list of proposals and ideas?
** If yes, what task did you choose? Please describe what part of it you especially want to focus on if you can already provide this information. ''Please also wiki-link the page for your elaborated proposal here.''
** If yes, what task did you choose? Please describe what part of it you especially want to focus on if you can already provide this information. ''Please also wiki-link the page for your elaborated proposal here.''
** If you apply for a task you have added yourself instead, please describe this task, its scope and people you already talked to concerning it. What field of tasks did you miss on the list?
** If you apply for a task you have added yourself instead, please describe this task, its scope and people you already talked to concerning it. What field of tasks did you miss on the list?


I would like to work on solving the problem described [[Summer_of_Code_Project_Ideas#Symbolic_package|here]]. Because the recent discussion on the octave-maintainers mailing list suggests it would be better to prepare a general method for liking Octave to Python and than apply this to this specific issue I would follow this way.


As already mentioned in the discussion there already exist a library intended for this purpose, namely Pytave. The library was intended to be used to calling Octave code from Python code, but as suggested its code base can potentially serve for two-way communication, especially because it already contains all the required conversions between Python and Octave types.


My project would consist of three main parts:
I would like to implement a general algorithm for maximum entropy reconstruction. This is an algorithm for estimating distributions which has applications in various inverse and/or ill-posed problems. It is used for deblurring/deconvolution of images, power spectrum estimation, smoothing, measurement data processing in biology, physics and more. The ground for the implementation would be the work of Skilling and Bryan [http://articles.adsabs.harvard.edu/full/1984MNRAS.211..111S]
* Cleaning up the Pytave library. This would include extracting the conversion functions between octave types and Python types (numpy arrays + primitive types), possibly leaving out legacy Python numeric types. This part would have to also include some C interface for both Octave and Python functions with proper exception mapping.
 
* Writing an Octave module which would allow to call Python functions from Octave. This part would be realized as oct-files linking to the code prepared in the previous step (probably as a part of Pytave). This part would also have to include some Python session management. As a stand alone package it could be become a useful thing by itself.
The algorithm would find its place in one of the existing packages (where ''optim'' or ''signal'' sound appropriate) or as a separate package. I plan to prepare two versions of the general algorithm, (temporal name {{codeline|maxent}})
* Substituting present way of communication between Octave and Python in Symbolic Package. Since now everything is said to be done on strings, substituting current pipe approach to the one resulting from the previous step shouldn't cause much too trouble.
* a version for problems defined by matrix. The function's declaration should be something like this
{{Code|Matrix problem declaration|<syntaxhighlight lang="octave" style="font-size:13px">function [x,info,...]=maxent(y,D,sigma,alpha=0.95, model=1, optset)
 
</syntaxhighlight>}}
 
 
where {{codeline|y} is the data vector, and {{codeline|D}} is the transformation matrix. {{codeline|sigma}} should be a vector or scalar which describes standard deviation of values of {{codeline|y}}. The optional parameter {{codeline|alpha}} and {{codeline|model}} describe confidence and a priori distribution of {{codeline|x}} (defaults to flat) respectively. The last parameter {{codeline|optset}} would allow to pass additional parameters to function, similar to the ones in {{codeline|optim}} package.
 
The returned value {{codeline|x}} is such that
 
<math> y \approx Dx</math>
 
where each of the coordinates of {{codeline|y}} lies within {{codeline|alpha}} confidence interval (normal distributed error assumed). Out of all possible {{codeline|x}} the one with the highest entropy is chosen. {{codeline|info}} describes the convergence of the algorithm. The other returned parameters will describe final gradients, Hessians and Lagrange's coefficient.
 
* the second calling form would be defined in a similar way, but with the transformation defined in the means of function provided by the user. The declaration would be:
{{Code|Functional problem declaration|<syntaxhighlight lang="octave" style="font-size:13px">function [x,info,...]=maxent(y,tfun,sigma,alpha=0.95, model=1, optset)
 
</syntaxhighlight>}}
 
All the parameters have the similar meaning here, and the new parameter {{codeline|tfun}} is the handle to a function which accepts vector argument, which describes the problem to be inverted. This time the returned value should obey
 
<math> y \approx \mbox{tfun}(x)</math>
 
It is convenient to have this version of the algorithm for problem where obtaining the transformation matrix is difficult to compute or affects performance (think fft). The algorithm is expected to give good results for linear functions. For not-too-complicated non-linear cases the chances are still there.
 
* the third version would be the most general one. Here, the chi-squared criterium used as the objective function can be substituted with an arbitrary function provided by the user (it should be a convex function to guarantee the uniqueness of the solution). The calling form would be
{{Code|Functional problem declaration|<syntaxhighlight lang="octave" style="font-size:13px">function [x,info,...]=maxent(objfun,aim, model=1, optset)
 
</syntaxhighlight>}}
 
The arguments {{codeline|objfun}} and {{codeline|aim}} are the objective function and a value of the objective function the algorithm should try to attain. The algorithm will try find {{codeline|x}} such that
<math> \mbox{aim} \approx \mbox{objfun}(x)  </math> and the entropy is the highest out of all the solutions with this property.
 
 
Additional  work will be put to provide some wrapper functions to allow the user quickly use MEM in specific problems. This includes function for 1D and image deconvolutions, time series components analysis, power spectral estimation and other applications I will be able to find in Matlab or other computational software.
 
Another sub-task is to analyze the speed and numerical precision of the implemented algorithms.
 
* Please provide a rough estimated timeline for your work on the task. ''This should include the GSoC midterms and personal commitments like exams or vacation ("non-coding time"). Optionally include two or three milestones you expect.''
 
** Start of GSoC
***''development of the algorithm in matrix version with future extension in mind''
** Midterm evaluation
***''upgrading the algorithm to accept the arbitrary objective function''
***''stability tests''
***''identification of the remaining issues''
***''adding wrappers for easy use''
 
** Final evaluation


Timeline (brief):
Timeline (brief):
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)