23 using namespace NNets;
48 void Softmax::execute(
const int sliceStart,
const int sliceStop,
const int threadIdx,
const int threadCount) {
51 for (
int i = sliceStart; i < sliceStop; ++i)
64 const float normFactor = 1 / sum;
72 InvalidArgument::check(view.getWidth() == 1 && view.getHeight() == 1,
"A column-like storage view is expected on input of Softmax operation.");
88 SoftmaxDeserializer() : Deserializer(
"softmax") {}
99 return new Softmax(block[
"_name"]);
109 {
"_type",
"softmax" }
Basic class: task and memory management, any kind of static data.
Real-valued vector usable by GPU.
void fetch(GraphicPipeline &gpu, std::vector< float > &output) const
Grabs vector values back from GPU to user memory.
Internal low-level GPU control API.
static void check(const bool condition, const std::string &message)
Enables construction of an operation from its serialized representation.
Abstract neural net operation (layer).
std::string getName() const
Operation computed on CPU.
static bool initDeserializer()
Sets up deserialization of the operation.
void beforeExecute(GraphicPipeline &gpu, const int threadCount)
Called right before the operation is executed.
std::vector< float > output
std::vector< float > partialSums
Softmax(const std::string &name="Softmax")
Creates a softmax layer.
void afterExecute(const int threadCount)
Called right after the operation is executed.
void execute(const int sliceStart, const int sliceStop, const int threadIdx, const int threadCount)
Executes the operation body within a specific CPU thread.
void disconnect()
Assigns empty inputs and outputs.
int getAmountOfWork() const
Returns amount of work in arbitrary units to be splitted among threads.
void setInput(Storage::View &&view, int index=0)
std::map< std::string, std::string > serialize() const
Returns a serialized representation of th operation;.
Scans a storageview in RAM for further computations on CPU.
void move(int x, int y)
Sets the pointer to a specific spatial position.
void fill(T begin, T limit)
Extracts the content of feature maps at the current position.
Maps a 3D tensor onto a storage.
void pull(GraphicPipeline &gpu)
Pulls storage data from GPU memory to RAM.
static void check(const datatype value, const datatype min, const datatype max, const char *message)
return(jlong) new Beatmup jlong jstring name
jobject jlong jint jint y