#pragma once

#include "./core/omp_config.h"

#include "./utils/vector.h"
#include "./utils/matrix.h"


namespace neural_networks{

	template <typename Td, typename Ti>
	struct Loss{

			utils::Matrix<Td> sample_losses;
			Td data_losses;

			virtual utils::Vector<Td> forward(const utils::Matrix<Td>& output, const utils::Matrix<Ti>& y) = 0;

			Td calculate(const utils::Matrix<Td>& output, const utils::Matrix<Ti>& y){
				// Calculate sample losses
				sample_losses = forward(output, y);

				// Calculate mean loss
				data_losses = numerics::mean(sample_losses);
				return data_losses;

			}


	};



} // end namespace neural_networks