Mini batch

mini-batch training merged, tested only little.