Learning Structured Compressed Sensing with Automatic Resource Allocation