当前位置: 首页>>代码示例>>Python>>正文


Python alexnet.AlexNet方法代码示例

本文整理汇总了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 
开发者ID:Vladkryvoruchko,项目名称:PSPNet-Keras-tensorflow,代码行数:27,代码来源:helper.py

示例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) 
开发者ID:Vladkryvoruchko,项目名称:PSPNet-Keras-tensorflow,代码行数:5,代码来源:helper.py

示例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 
开发者ID:Vladkryvoruchko,项目名称:PSPNet-Keras-tensorflow,代码行数:7,代码来源:helper.py


注:本文中的alexnet.AlexNet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。