Nx manipulating big images with immutable variables

I just watched Fireside chat with on Machine Learning in Elixir, where Jose mentioning the difficulties of manipulating big images with immutable variables, which requires to copy the whole variable even for changing one pixel.
I have no experience on this topic but I was thinking about a collection of states of such image (a list), the first element will be the original image and the following items will be the deltas. Something similar to what Git does on each commit, the Git history is immutable (?) and it can be huge, however Git pointer to current can move back and forth without much effort, in order to do or undo changes on a given repository.
I don’t know how stupid this idea is, but definitely I will learn something from your comments.

1 Like

Git do not work like that. Git always store all files in repo in each commits. Git uses delta compression, but that do not mean that it stores diffs. If you want diffing SCM then there is Darcs and Pijul that support that.

2 Likes

My assumptions were wrong and I learnt something today, thank you for your comment!

2 Likes

What you suggest is very similar to what libvips does. It accumulates a list of transforms (operations in libvips speak) and only applies the transformations when rendering a final image. Not saying this would work for many of the Nx uses cases though!

1 Like