inference now working. runs all queries needed for gradient ascent.