Live data from Hacker News

Using machine learning to choose compression algorithms

vks.ai

21–30 of 60 posts

Re: Using machine learning to choose compression algorithms

#21

Is it possible to run data through a DNN, making sure the output is the same as the input (or close for lossless data), then take an autoencoder variant, record the 'compressed' data, then on the other end have the other half of the DNN to decompress it? I'm pretty ignorant on the topic, so I get that that may be off, but if so, why wouldn't that be a valid solution to compressing data?

Autoencoders have lossy compression.

Re: Using machine learning to choose compression algorithms

#22
post #2

Isn't one of the benefits of time-series databases more compact storage at minimal overhead?

Does anyone know what is the leading time-series database people use today? Like, eg, bar / tick data. (I use PostgreSQL, due to my ignorance.)

If you can model the domain, then you can achieve very good compression.

See this recent timescaledb post (since you mentioned Postgres) which goes over an array of techniques used in column-store databases that general-purpose compressors on a csv file full of data would not be able to match:

https://blog.timescale.com/blog/building-columnar-compressio... discussion: https://news.ycombinator.com/item?id=21412596

Re: Using machine learning to choose compression algorithms

#23

Is it possible to run data through a DNN, making sure the output is the same as the input (or close for lossless data), then take an autoencoder variant, record the 'compressed' data, then on the other end have the other half of the DNN to decompress it? I'm pretty ignorant on the topic, so I get that that may be off, but if so, why wouldn't that be a valid solution to compressing data?

Indeed, but this is for lossless compression :)

Re: Using machine learning to choose compression algorithms

#24
post #2

Isn't one of the benefits of time-series databases more compact storage at minimal overhead?

Does anyone know what is the leading time-series database people use today? Like, eg, bar / tick data. (I use PostgreSQL, due to my ignorance.)

There's TimescaleDB built on top of PostgreSQL.

Re: Using machine learning to choose compression algorithms

#25
post #6

Earlier quoted context omitted.

I'm a long time fan of your blog :O

Me too! A few months ago I made detailed notes on how to set up your own: https://github.com/shawwn/wiki Gwern was kind enough to assist by sending over the exact version numbers of all the Haskell libraries it depends on, and answering some questions about deployment. The version numbers turned out to be crucial to getting everything running. IMO https://www.gwern.net/ is the ideal combination of style + ease of use…

Yea, look at jekyll in combination with github pages. You can see my blog for example (https://vks.ai), the code is hosted here: https://github.com/kootenpv/kootenpv.github.io

Re: Using machine learning to choose compression algorithms

#26
post #12
post #8

Earlier quoted context omitted.

I'm assuming the game is playable, i.e. the decompression code is included on the cartridge and you just don't know how it works. In that case you could emulate the game and use a language model to identify strings containing Japanese text (you'd need to know the encoding to do that) so they can be extracted for translation. That doesn't allow you to put the translations into the compressed code, but you might be abl…

You might as well write a tool that extracts strings from a video signal using OCR, and translates them. That would make the solution more universal, and you could even use it to e.g. suppress ads.

Well that's super hard since Japanese encoding is an epic story in digital archaeology itself.

Re: Using machine learning to choose compression algorithms

#27
post #8

Is there a way to do the reverse? There's a quite "legendary" Game Boy Advance game out there (Klonoa - Densetsu no Star Medal) that never got a translation to English because it has some sort of in-house created compression by Namco applied to the game that was made so it could fit into a GBA cartridge. AFAIK no one was ever able to crack it open and release the code to de/compress it. A while ago I had a "bounty" o…

I'm assuming the game is playable, i.e. the decompression code is included on the cartridge and you just don't know how it works. In that case you could emulate the game and use a language model to identify strings containing Japanese text (you'd need to know the encoding to do that) so they can be extracted for translation. That doesn't allow you to put the translations into the compressed code, but you might be abl…

The GBA didn't have much RAM. There is a good chance tiny chunks of the game get decompressed as needed, and there is never a time when the whole thing is decompressed at once and can be dumped.

Re: Using machine learning to choose compression algorithms

#28

A somewhat different example but related (at least by name) but I recall an article from Chris Wellons' blog, Null Program, where he wanted to "discover" a new hashing algorithm, so he randomly generated them, JT compiled them to native, then tested them. There was, how ever, no machine learning or optimizing. Instead, he called it "prospecting" and just generate a new one from scratch each time until he found someth…

Yea - that is related to genetic programming. That, and using auto-encoders for e.g. image compression are known approaches in "AI". I'm particularly proud of this meta approach and I am actually thinking this could become huge: the same thing can be done for hyperparameter optimization in machine learning tasks. Hyperparamter optimization is currently focused on minimizing cross-validation error, but using this conc…

> I'm particularly proud of this meta approach and I am actually thinking this could become huge: the same thing can be done for hyperparameter optimization in machine learning tasks.

There is already a substantial field of Machine Learning/Meta Learning which focuses on exactly this. For example, this paper [1] from NeurIPS 2015 does exactly what you suggest.

[1]: https://papers.nips.cc/paper/5872-efficient-and-robust-autom...

Re: Using machine learning to choose compression algorithms

#29
post #18

Earlier quoted context omitted.

Spot on (I briefly touch on this in the article)! This is why I try to work with cheap-to-compute features. I used to calculate how unique all values were, but ended up taking a sample instead to speed that part up for large data!

How does that compare to just doing compression on a sample of data? :)

Running the compression algorithms is O(kn) where k is the number of compression algorithms. Taking the machine learning approach is O(n).

Re: Using machine learning to choose compression algorithms

#30

Earlier quoted context omitted.

Yea - that is related to genetic programming. That, and using auto-encoders for e.g. image compression are known approaches in "AI". I'm particularly proud of this meta approach and I am actually thinking this could become huge: the same thing can be done for hyperparameter optimization in machine learning tasks. Hyperparamter optimization is currently focused on minimizing cross-validation error, but using this conc…

> I'm particularly proud of this meta approach and I am actually thinking this could become huge: the same thing can be done for hyperparameter optimization in machine learning tasks. There is already a substantial field of Machine Learning/Meta Learning which focuses on exactly this. For example, this paper [1] from NeurIPS 2015 does exactly what you suggest. [1]: https://papers.nips.cc/paper/5872-efficient-and-robu…

Yea I am aware of meta hyperparameter approach for ML, except they only focus on accuracy instead of also including train/prediction times in to the equation :) That's what I was referring to! (you can save A LOT of compute and zoom in on things that work if you can weed out slow / badly performing algorithms as part of meta learning hyperparameters).

To make it extra clear: by doing a lot of compute on different datasets and not only recording the accuracy but also time it took, and then by including that as dimension it will even give better results.

Post reply on HN