zoukankan      html  css  js  c++  java
  • border_mode

    如果border_mode选择为same,那么卷积操作的输入和输出尺寸会保持一致。如果选择valid,那卷积过后,尺寸会变小

    # apply a 3x3 convolution with 64 output filters on a 256x256 image:
    model = Sequential()
    model.add(Convolution2D(64, 3, 3, border_mode='same', input_shape=(3, 256, 256)))
    # now model.output_shape == (None, 64, 256, 256)

    >> definition in keras:
    def conv_output_length(input_length, filter_size, border_mode, stride):  
        if input_length is None:  
            return None  
        assert border_mode in {'same', 'valid'}  
        if border_mode == 'same':  
            output_length = input_length  
        elif border_mode == 'valid':  
            output_length = input_length - filter_size + 1  
        return (output_length + stride - 1) // stride
  • 相关阅读:
    模板语法 DTL(Django Template Language )
    django基础
    day1,基本标签总结
    聚合函数
    day1
    day 3 定时任务
    day 4 tar
    day 6
    day1 mysql
    day 6
  • 原文地址:https://www.cnblogs.com/nkh222/p/7568817.html
Copyright © 2011-2022 走看看