Algorithm for Deep Connections gramplet