Machine learning bridges microslips and slip avalanches of sheared granular gouge