def __init__(self, horiz=False, vert=False, prob=0.5):
"""
Only one of horiz, vert can be set.
:param horiz: whether or not apply horizontal flip.
:param vert: whether or not apply vertical flip.
:param prob: probability of flip.
"""
super(Flip, self).__init__()
if horiz and vert:
raise ValueError("Please use two Flip instead.")
elif horiz:
self.code = 1
elif vert:
self.code = 0
else:
raise ValueError("Are you kidding?")
self.prob = prob
self._init()
评论列表
文章目录