Learning osmosis by osmosis