com.komputation.cuda.network.CudaBackwardPropagation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of komputation Show documentation
Show all versions of komputation Show documentation
Komputation is a neural network framework for the JVM written in the Kotlin programming language.
package com.komputation.cuda.network
import jcuda.Pointer
import com.komputation.cuda.layers.CudaEntryPoint
import com.komputation.cuda.layers.CudaForwardLayer
class CudaBackwardPropagator(
private val entryPoint: CudaEntryPoint,
private val layers : Array) {
private val numberLayers = this.layers.size
fun backward(lossGradient : Pointer, batchSize: Int): Pointer {
var chain = lossGradient
for(indexLayer in this.numberLayers - 1 downTo 0) {
val layer = this.layers[indexLayer]
chain = layer.backward(batchSize, chain)
}
return this.entryPoint.backward(chain)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy