<commit_before>// Parameterised Neural Net With Sigmoid.cpp : Defines the entry point for the console application.
//

#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#define LEARNING_RATE 0.1
#define TXTFILE ".txt"
#define NETWORKNUMBER ""
#define FILEPATH ".\\"

double sigmoid(double x);
void randomise(double* input, int inputcomponents);
void net_layer(double* input, int num_of_inputs, double* output, int num_of_outputs, double* w, double* b, double* dpred_dout, int training_flag);
void file_open_check(FILE* file, char* file_name);
void training(double*dpred_dout,double* dout_dw, double* dprev, int num_neurons_n, int num_neurons_1, int num_neurons_0, double* w, double* b);

//defining globals
int training_flag = 0;



int main()
{
    double converge_lim = 0;
    int converge_count = 0;

	//////////////////////////////////////////////////////////// READING FROM INITIALISATION FILE //////////////////////////////////////////////////////////////////////////////////////////

	//Opening the initialisation file
	FILE *init_file;
	init_file = fopen(FILEPATH"NN_init" NETWORKNUMBER TXTFILE , "r");
	file_open_check(init_file, "INITIALISATION");

	int num_layers, data_volume;
	double iterations;
	fscanf(init_file, "%d\t %lf\t %d\t %d\t", &training_flag, &iterations, &num_layers, &data_volume);
	//Error checking for the initialisation file starts here
	if ((training_flag < 0) | (training_flag > 2))
	{
		printf("ERROR! Training flag must be the values 0, 1 or 2! Check initialisation file!\nExiting program now\n");
		return(1);
	}
	if ((iterations < 0))
	{
		printf("ERROR! Iterations must be greater than 0! Check initialisation file!\nExiting program now\n");
		return(1);
	}
	if ((num_layers < 2))
	{
		printf("ERROR! Number of layers must be greater than 2! Check initialisation file!\nExiting program now\n");<commit_msg>removed those bits<commit_after>// Parameterised Neural Net With Sigmoid.cpp : Defines the entry point for the console application.
//

#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#define LEARNING_RATE 0.1
#define TXTFILE ".txt"
#define NETWORKNUMBER ""
#define FILEPATH ".\\"

double sigmoid(double x);
void randomise(double* input, int inputcomponents);
void net_layer(double* input, int num_of_inputs, double* output, int num_of_outputs, double* w, double* b, double* dpred_dout, int training_flag);
void file_open_check(FILE* file, char* file_name);
void training(double*dpred_dout,double* dout_dw, double* dprev, int num_neurons_n, int num_neurons_1, int num_neurons_0, double* w, double* b);

//defining globals
int training_flag = 0;



int main()
{

	//////////////////////////////////////////////////////////// READING FROM INITIALISATION FILE //////////////////////////////////////////////////////////////////////////////////////////

	//Opening the initialisation file
	FILE *init_file;
	init_file = fopen(FILEPATH"NN_init" NETWORKNUMBER TXTFILE , "r");
	file_open_check(init_file, "INITIALISATION");

	int num_layers, data_volume;
	double iterations;
	fscanf(init_file, "%d\t %lf\t %d\t %d\t", &training_flag, &iterations, &num_layers, &data_volume);
	//Error checking for the initialisation file starts here
	if ((training_flag < 0) | (training_flag > 2))
	{
		printf("ERROR! Training flag must be the values 0, 1 or 2! Check initialisation file!\nExiting program now\n");
		return(1);
	}
	if ((iterations < 0))
	{
		printf("ERROR! Iterations must be greater than 0! Check initialisation file!\nExiting program now\n");
		return(1);
	}
	if ((num_layers < 2))
	{
		printf("ERROR! Number of layers must be greater than 2! Check initialisation file!\nExiting program now\n");
{'fraction_non_alphanumeric': 0.19065520945220193, 'fraction_numerical': 0.009129967776584319, 'mean_word_length': 3.3669402110199296, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6006344', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1169, 'n_words': 367}