本文整理汇总了Python中alexnet.AlexNet方法的典型用法代码示例。如果您正苦于以下问题:Python alexnet.AlexNet方法的具体用法?Python alexnet.AlexNet怎么用?Python alexnet.AlexNet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类alexnet
的用法示例。
在下文中一共展示了alexnet.AlexNet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import alexnet [as 别名]
# 或者: from alexnet import AlexNet [as 别名]
def __init__(self,
batch_size,
scale_size,
crop_size,
isotropic,
channels=3,
mean=None,
bgr=True):
# The recommended batch size for this model
self.batch_size = batch_size
# The image should be scaled to this size first during preprocessing
self.scale_size = scale_size
# Whether the model expects the rescaling to be isotropic
self.isotropic = isotropic
# A square crop of this dimension is expected by this model
self.crop_size = crop_size
# The number of channels in the input image expected by this model
self.channels = channels
# The mean to be subtracted from each image. By default, the per-channel ImageNet mean.
# The values below are ordered BGR, as many Caffe models are trained in this order.
# Some of the earlier models (like AlexNet) used a spatial three-channeled mean.
# However, using just the per-channel mean values instead doesn't affect things too much.
self.mean = mean if mean is not None else np.array([104., 117., 124.])
# Whether this model expects images to be in BGR order
self.expects_bgr = True
示例2: alexnet_spec
# 需要导入模块: import alexnet [as 别名]
# 或者: from alexnet import AlexNet [as 别名]
def alexnet_spec(batch_size=500):
'''Parameters used by AlexNet and its variants.'''
return DataSpec(batch_size=batch_size, scale_size=256, crop_size=227, isotropic=False)
示例3: std_spec
# 需要导入模块: import alexnet [as 别名]
# 或者: from alexnet import AlexNet [as 别名]
def std_spec(batch_size, isotropic=True):
'''Parameters commonly used by "post-AlexNet" architectures.'''
return DataSpec(batch_size=batch_size, scale_size=256, crop_size=224, isotropic=isotropic)
# Collection of sample auto-generated models