All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.komputation.cpu.layers.forward.activation.CpuActivationLayer.kt Maven / Gradle / Ivy

Go to download

Komputation is a neural network framework for the JVM written in the Kotlin programming language.

There is a newer version: 0.12.5
Show newest version
package com.komputation.cpu.layers.forward.activation

import com.komputation.cpu.layers.CpuForwardLayer
import com.komputation.layers.CpuActivationLayerInstruction
import com.komputation.layers.forward.activation.*

fun cpuActivationLayer(name: String?, function: ActivationFunction, numberRows : Int, numberColumns : Int) : CpuActivationLayerInstruction =

    when (function) {

        ActivationFunction.Identity ->
            identityLayer(name, numberRows, numberColumns)
        ActivationFunction.ReLU ->
            reluLayer(name, numberRows, numberColumns)
        ActivationFunction.Sigmoid ->
            sigmoidLayer(name, numberRows, numberColumns)
        ActivationFunction.Softmax ->
            softmaxLayer(name, numberRows, numberColumns)
        ActivationFunction.Tanh ->
            tanhLayer(name, numberRows, numberColumns)

    }

interface CpuActivationLayer : CpuForwardLayer




© 2015 - 2025 Weber Informatics LLC | Privacy Policy