A framework of algorithms and associated tool for on-device tiny learning