home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (LocalResponseNormalization.java)

This example Java source code file (LocalResponseNormalization.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

allargsconstructor, builder, data, equalsandhashcode, layer, localresponsenormalization, noargsconstructor, override, tostring

The LocalResponseNormalization.java Java example source code

package org.deeplearning4j.nn.conf.layers;

import lombok.*;

/**
 * Created by nyghtowl on 10/29/15.
 */
@Data @NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class LocalResponseNormalization extends Layer{
    // hyper-parameters defined using a validation set
    protected double n; // # adjacent kernal maps
    protected double k; // constant (e.g. scale)
    protected double beta; // decay rate
    protected double alpha; // decay rate

    private LocalResponseNormalization(Builder builder) {
        super(builder);
        this.k = builder.k;
        this.n = builder.n;
        this.alpha = builder.alpha;
        this.beta = builder.beta;
    }

    @Override
    public LocalResponseNormalization clone() {
        LocalResponseNormalization clone = (LocalResponseNormalization) super.clone();
        return clone;
    }

    @AllArgsConstructor
    public static class Builder extends Layer.Builder<Builder> {
        // defaults based on AlexNet model
        private double k=2;
        private double n=5;
        private double alpha=1e-4;
        private double beta=0.75;

        public Builder(double k, double alpha, double beta) {
            this.k = k;
            this.alpha = alpha;
            this.beta = beta;
        }

        public Builder() {}

        public Builder k(double k){
            this.k = k;
            return this;
        }

        public Builder n(double n){
            this.n = n;
            return this;
        }

        public Builder alpha(double alpha){
            this.alpha = alpha;
            return this;
        }

        public Builder beta(double beta){
            this.beta = beta;
            return this;
        }

        @Override
        public LocalResponseNormalization build() {
            return new LocalResponseNormalization(this);
        }

    }

}

Other Java examples (source code examples)

Here is a short list of links related to this Java LocalResponseNormalization.java source code file:



my book on functional programming

 

new blog posts

 

Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.