Hey there, can you write code for an ANN with backpropogation without using deep…
- User
Hey there, can you write code for an ANN with backpropogation without using deep learning libraries. You have to use GPUs for parallelisation. You can use regular python libraries but not deep learning ones like pytorch, keras or tensorflow. Calculate error using MAPE.
b.You will first train and validate your ANN on the toy problem of learning the mathematical function y = sin(x), where -2pi <=x<=2pi. Unless you can complete the toy problem successfully, do not get into the more complex regression functions mentioned below. The steps of this toy problem are the following: b1.Extract 1000 (x, y) pairs equally distributed within the domain --2pi <=x<=2pi. The total domain is 4pi, split it equally into 4 parts and extract 250 points from each, again with equal intervals. Use this for training your ANN – note that you have only 1 input and 1 output b2.Extract 300 points randomly within the same range -2pi <=x<=2pi., using some uniform-distribution random-number generator in Python (numpy). Note you are creating only the x-values; your ANN will generate the y-values as outputs. This will be the validation data b3.Plot the x-y curves extracted from the data in b1 on the same plot extracted from the outputs of your ANN in b2. The two plots should be almost sitting on each other, for proving correctness of your ANN
The data set is 2 excel sheets with more than 9 thousand rows pf 4 input and 1 output variable.(5 sheets each containing that many). split the available data into 72 : 18 : 10 for training : validation : testing.
Apart from the fact that the number of nodes in the input layer equals the number of input variables, and correspondingly for output layer, and that there has to be at least one hidden layer, the rest is your creation. Just remember one rule of thumb, the number of unknowns should not be more than half the number of training data samples. So one hidden layer will have some number of neurons, and if you increase the number of hidden layers then the nodes per layer will reduce by the above rule.
Activation function is tanh. Use mini-batches between sizes 64 and 256. However, at extreme ends, you should test with batch sizes of 1 (effectively SGD) and the full batch. Also, shuffle the order of presentation of mini-batches across epochs. Observe the impact of mini-batch sizes on training and validation convergence histories. Take the four sizes 1, 64, 256 and then full batch.
Normalise inputs and outputs between -1 and 1.
Take learning rate parameter as 0.001 and do L2 regularization
- Assistant
- User
I am running this code on Jupyter Notebook. Can you modify the code so that it is importing the folder containing the excel sheet? and then running the book.
- Assistant
- User
The folder is named CCPP and the excel sheet consists of 5 columns- AT,V,AP,RH,PE
- Assistant
- User
/home/pradyumnas/Desktop/Mahindra/Sem6/NN/CCPP This is the file path, it contains 2 excel files Each has 5 sheets Can you please modify the code
- Assistant
Given the updated details that the file path "/home/pradyumnas/Desktop/Mahindra/Sem6/NN/CCPP" contains 2 Excel files and each of these files has 5 sheets, we need to adjust our data loading function to iterate through each sheet in each Excel file. Let's refine the function to account for these conditions and ensure that data from all sheets across all files are concatenated properly into a single DataFrame.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.