當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。