Rank: 1937 based on 75 downloads (last 30 days) and 3 files submitted
photo

Christian Kothe

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Christian View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
26 Jan 2012 Fast serialize/deserialize These functions can serialize most MATLAB data structures into a byte vector and vice versa. Author: Christian Kothe serialize, export, import 52 8
  • 4.875
4.9 | 8 ratings
19 Jan 2012 Fast moving average A fast implementation of the moving average filter for long kernels. Author: Christian Kothe statistics, signal processing 17 3
  • 5.0
5.0 | 1 rating
12 Jan 2012 Micro-cache: memoize/cache function results A simple helper to avoid re-calculating the same results repeatedly. Author: Christian Kothe optimization 6 0
Comments and Ratings by Christian View all
Updated File Comments Rating
16 Jan 2012 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren

Compiling this on a more or less vanilla Linux GCC setup through mex brought up a couple of issues for me:

* lbfgs_.c uses C++-style "//" comments, which gets the compiler enraged (I changed these to C-style)

* on non-MSVC platforms you'd need to also define HAVE_XMMINTRIN_H and HAVE_EMMINTRIN_H to get SSE to work (otherwise the relevant headers are not included by liblbfgs)

* liblbfgs uses the "inline" keyword which is not defined on my OS (while __inline is). I added the following to each of the arithmetic_*.h files:

#ifndef inline
#ifdef __inline
#define inline __inline
#else
#define inline
#endif
#endif

I think the latter 2 issues come up because liblbfgs relies on the automake / config.h mechanism to define the relevant macros/identifiers.

The following mex line then compiles it for me:

mex -DHAVE_EMMINTRIN_H -DHAVE_XMMINTRIN_H -DUSE_SSE -I"liblbfgs-1.10/include" -largeArrayDims lbfgs_.c liblbfgs-1.10/lib/lbfgs.c

16 Jan 2012 Fast moving average A fast implementation of the moving average filter for long kernels. Author: Christian Kothe

Thanks for spotting the scalar-X issue, Jan! Fixed now.

Also, you're right -- for N<500 (or so) filter is in fact faster. So this case is now covered by calling filer.

This code has been written to handle N>10000 (and length(X)>1000000) at decent speeds.

Comments and Ratings on Christian's Files View all
Updated File Comment by Comments Rating
20 Mar 2014 Fast serialize/deserialize These functions can serialize most MATLAB data structures into a byte vector and vice versa. Author: Christian Kothe Jan

Unfortunetaly, I cannot save my save file. Using '-v7.3', it needs about one minute to save (filesize is about 300MB). When I try to serialize the data, after lots of warnings "Calling STRUCT on an object ..." I get an OUT OF MEMORY Error.

My Save object consists of several (handle) objects and is, as I said, about 300MB in size when saved with '-v7.3'.

Is there anything I can do? (My Computer is win7 32bit with 3gb ram)

Thanks in advance!

Jan

01 Mar 2014 Fast serialize/deserialize These functions can serialize most MATLAB data structures into a byte vector and vice versa. Author: Christian Kothe Champion, Andrew

Great tool, but there is a bug I encountered that may also be the underlying cause of Mahdi's problems. In deserialization of horizontal string cell arrays, hlp_deserialize.m:246, the string splitting loop should be

for 1:length(splits)-1

not how it currently is written,

for 1:length(lengths)

As it's currently written it will not properly deserialize multidimensional horizontal string cell arrays.

09 Feb 2014 Fast serialize/deserialize These functions can serialize most MATLAB data structures into a byte vector and vice versa. Author: Christian Kothe Pandarinath, Chethan

03 Dec 2013 Fast serialize/deserialize These functions can serialize most MATLAB data structures into a byte vector and vice versa. Author: Christian Kothe Hespanha, Joao

Great tools. It can really improve the saving speed.

I made some changes to code posted here to make it compatible with the new table and categorical classes. I've not tested enough to post to, but please let me know if someone wants to try it.

26 Oct 2013 Fast serialize/deserialize These functions can serialize most MATLAB data structures into a byte vector and vice versa. Author: Christian Kothe Kefayati, Mahdi

First off, this code is amazing! I helped serializing a cell array which would take ~26GB to merely ~1GB and subsequently saved me a lot of time saving and loading the file.

I was wondering if it is possible to improve the performance of this function by using parallelism.

Also, it seems, that I am facing a bug. What I serialize is a cell array similar to what is generated by textscan when similar filed grouping is enabled:
offers =

[15445674x1 double] {15445674x3 cell} [15445674x81 double] {15445674x1 cell} [15445674x6 double]

When I serialize and then deserialize this cell array, strings in some, but not all, of the columns of one of the cell arrays disappear. That is:
>> offers{2}(1:5,:)

ans =

'N' 'BUCHAN_BUCHANG2' 'HYDRO'
'N' 'MGSES_CT1' 'SCLE90'
'N' 'GRSES_UNIT2' 'GSREH'
'N' 'OKLA_OKLA_G1_J03' 'CLLIG'
'N' 'DOWGEN_DOW_G37' 'SCLE90'

However:
>> offers_d=hlp_deserialize(hlp_serialize(offers));
>> offers_d{2}(1:5,:)

ans =

'N' [] []
'N' [] []
'N' [] []
'N' [] []
'N' [] []

Any thoughts on what is the culprit?

Contact us