def model_pred_on_gen_batch(model, b_gen, b_idx=0):
    """
    Predict on model for single batch returned from a data generator.
    Returns predictions as well as corresponding targets.
    """
    
    # predict on model
    X,y = b_gen.__getitem__(b_idx)
    pred = model.predict_on_batch(X)
    return pred, y