Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ void add_population_to_h5<core::Population<knp::neuron_traits::SynapticResourceS
PUT_NEURON_TO_DATASET(population, first_isi_spike_, group0);
PUT_NEURON_TO_DATASET(population, is_being_forced_, group0);
PUT_NEURON_TO_DATASET(population, dopamine_plasticity_time_, group0);
PUT_NEURON_TO_DATASET(population, additional_threshold_, group0);
{
std::vector<int> data;
data.reserve(population.size());
Expand All @@ -125,6 +124,7 @@ void add_population_to_h5<core::Population<knp::neuron_traits::SynapticResourceS
PUT_NEURON_TO_DATASET(population, bursting_phase_, dynamic_group0);
PUT_NEURON_TO_DATASET(population, total_blocking_period_, dynamic_group0);
PUT_NEURON_TO_DATASET(population, dopamine_value_, dynamic_group0);
PUT_NEURON_TO_DATASET(population, additional_threshold_, dynamic_group0);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class KNP_DECLSPEC Dataset final : public classification::Dataset

/**
* @brief Create a incrementing image to spikes converter
* @detail Spikes will be sent for active_steps steps, and spikes wont be sent for steps_per_image-active_steps
* @details Spikes will be sent for active_steps steps, and spikes wont be sent for steps_per_image-active_steps
* steps. This converter considered incrementing because it will add state_increment_factor * image_pixel to states,
* and when value is greater than one, this considered a spike.
* @param active_steps Amount of active steps, active steps are steps when spikes being sent, must be <
Expand All @@ -90,7 +90,7 @@ class KNP_DECLSPEC Dataset final : public classification::Dataset

/**
* @brief Get image size.
* @ret Image size.
* @return Image size.
*/
[[nodiscard]] size_t get_image_size() const { return image_size_; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,36 @@ class KNP_DECLSPEC InferenceResultForClass
public:
/**
* @brief Get true positives.
* @ret Amount of times model, that is supposed to predict dog, predicted dog when it is a dog.
* @return Amount of times model, that is supposed to predict dog, predicted dog when it is a dog.
*/
[[nodiscard]] size_t get_true_positives() const { return true_positives_; }

/**
* @brief Get false negatives.
* @ret Amount of times model, that is supposed to predict dog, predicted not a dog when it is a dog.
* @return Amount of times model, that is supposed to predict dog, predicted not a dog when it is a dog.
*/
[[nodiscard]] size_t get_false_negatives() const { return false_negatives_; }

/**
* @brief Get false positives.
* @ret Amount of times model, that is supposed to predict dog, predicted dog when it is not a dog.
* @return Amount of times model, that is supposed to predict dog, predicted dog when it is not a dog.
*/
[[nodiscard]] size_t get_false_positives() const { return false_positives_; }

/**
* @brief Get true negatives.
* @ret Amount of times model, that is supposed to predict dog, predicted not a dog when it is a not a dog.
* @return Amount of times model, that is supposed to predict dog, predicted not a dog when it is a not a dog.
*/
[[nodiscard]] size_t get_true_negatives() const { return true_negatives_; }

/**
* @brief Shortcut for getting total votes.
* @ret Total votes.
* @return Total votes.
*/
[[nodiscard]] size_t get_total_votes() const { return true_positives_ + false_negatives_ + false_positives_; }

/**
* @detail A class to process inference results.
* @details A class to process inference results.
*/
class KNP_DECLSPEC InferenceResultsProcessor
{
Expand All @@ -79,7 +79,6 @@ class KNP_DECLSPEC InferenceResultForClass
* @brief Process inference results. Suited for classification models.
* @param spikes All spikes from inference.
* @param dataset Dataset.
* @return processed inference results for each class.
*/
void process_inference_results(
const std::vector<knp::core::messaging::SpikeMessage> &spikes,
Expand All @@ -93,7 +92,7 @@ class KNP_DECLSPEC InferenceResultForClass

/**
* @brief Get inference results.
* @ret Inference results.
* @return Inference results.
*/
[[nodiscard]] auto const &get_inference_results() const { return inference_results_; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace knp::framework::inference_evaluation
* @brief Calculate precision.
* @param true_positives Amount of times model, that is supposed to predict dog, predicted dog when it is a dog.
* @param false_positives Amount of times model, that is supposed to predict dog, predicted dog when it is not a dog.
* @return Precicion. true_positives / (true_positives + false_positives).
*/
KNP_DECLSPEC float get_precision(size_t true_positives, size_t false_positives);

Expand All @@ -39,6 +40,7 @@ KNP_DECLSPEC float get_precision(size_t true_positives, size_t false_positives);
* @brief Calculate recall.
* @param true_positives Amount of times model, that is supposed to predict dog, predicted dog when it is a dog.
* @param false_negatives Amount of times model, that is supposed to predict dog, predicted not a dog when it is a dog.
* @return Recall. true_positives / (true_positives + false_negatives).
*/
KNP_DECLSPEC float get_recall(size_t true_positives, size_t false_negatives);

Expand All @@ -50,6 +52,7 @@ KNP_DECLSPEC float get_recall(size_t true_positives, size_t false_negatives);
* @param false_positives Amount of times model, that is supposed to predict dog, predicted dog when it is not a dog.
* @param true_negatives Amount of times model, that is supposed to predict dog, predicted not a dog when it is a not a
* dog.
* @return Prevalence. (true_positives + false_negatives) / total_predictions.
*/
KNP_DECLSPEC float get_prevalence(
size_t true_positives, size_t false_negatives, size_t false_positives, size_t true_negatives);
Expand All @@ -62,6 +65,7 @@ KNP_DECLSPEC float get_prevalence(
* @param false_positives Amount of times model, that is supposed to predict dog, predicted dog when it is not a dog.
* @param true_negatives Amount of times model, that is supposed to predict dog, predicted not a dog when it is a not a
* dog.
* @return Accuracy. (true_positives + true_negatives) / total_predictions.
*/
KNP_DECLSPEC float get_accuracy(
size_t true_positives, size_t false_negatives, size_t false_positives, size_t true_negatives);
Expand All @@ -71,7 +75,8 @@ KNP_DECLSPEC float get_accuracy(
* @brief Calculate f measure.
* @param precision Precision.
* @param recall Recall.
* @return FMeasure. 2 * precision * recall / (precision + recall).
*/
KNP_DECLSPEC float get_f_measure(float precision, float recall);

} //namespace knp::framework::inference_evaluation
} // namespace knp::framework::inference_evaluation
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/**
* @brief Namespace for framework projection creators.
* @detail Creators make generators
* @details Creators make generators
*/
namespace knp::framework::projection::creators
{
Expand Down
Loading