1. A method for training a machine learning system to structure data in accordance with a non-differentiable cost function, comprising: generating structured data from a set of input data; obtaining at least one estimated gradient based at least in part upon the structured data and at least one requirement of the cost function; and updating at least one parameter of the machine learning system based upon the at least one estimated gradient.