<jupyter_start><jupyter_text>NETWORK WITH TWO HIDDEN LAYERS<jupyter_code>import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
from IPython.display import display
import vnns<jupyter_output><empty_output><jupyter_text>On the remaining six datasets, the strategy will be just the same as in the previous notebook with the exception that we now set num_hidden_layers = 2 (two hidden layers) and total_units_max = 20 (we cannot have more than 20 units total on those two hidden layers.) Note that this means in each layer we cannot have more than 10 units since for hidden_units = 'auto', our code imposes the same number of units for each layer (a selection that does not have a theoretical foundation but rather based on rather random evaluations confirming its effectiveness.) Maximum 10 units per layer selection is also equally arbitrary. Let's plot the training set decision boundary and display the summary table for each remaining dataset as we did in earlier notebooks:<jupyter_code>for data in ['elliptic1','elliptic2','complex2','complex3','complex4','multiclass3']:
    print("\n\n*** Data:", data, "***")
    dla = vnns.DeepLearnAuto(datafile = "Data\\Medium\\"+data+"_tr.csv", 
                             normalize = True, 
                             polydeg = 1,
                             method = 'GD',                             
                             initialize = 'deep',
                             learning_rate= 'auto', 
                             lamda = 'auto',
                             maxiter = 10000, 
                             hidden_units = 'auto',
                             num_hidden_layers = 2, 
                             total_units_max = 20,  
                             plot_output = True)
    summary = dla.generate_summary()
    display(summary)<jupyter_output>*** Data: elliptic1 ***<jupyter_text>The use of two hidden layers allows two more datasets (which had failed with no or a single hidden layer) to pass the threshold of 1.8 for training and test scores combined: complex4 and multiclass3. Below, we run once again those files by setting the plotting/reporting options to True. On the other hand note that the remaining datasets except complex3 showed improvement versus single hidden layer case although they still were not able to meet the success criterion.<jupyter_code>scoreboard = pd.DataFrame()
for data in ['complex1','complex4','multiclass3']:
    print("\n\n*** Data:", data, "***")
    dla = vnns.DeepLearnAuto(datafile = "Data\\Medium\\"+data+"_tr.csv", 
                             normalize = True,
                             polydeg = 1,
                             method = 'GD',                             
                             initialize = 'deep',
                             learning_rate= 'auto', 
                             lamda = 'auto',
                             maxiter = 10000, 
                             hidden_units = 'auto',
                             num_hidden_layers = 2, 
                             total_units_max = 20, 
                             plot_J = True, 
                             report_summary = True, 
                             plot_output = True,
                             plot_test = True,
                             plot_hidden = True,
                             plot_lam = True)
    summary = dla.generate_summary()
    scoreboard = scoreboard.append(summary,ignore_index=True)
print ("\n\n*** Summary ***")
display(scoreboard)<jupyter_output>*** Data: complex1 ***
{'fraction_non_alphanumeric': 0.07599551318003366, 'fraction_numerical': 0.012058328659562535, 'mean_word_length': 1.7998430141287285, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '378229', 'license': 'MIT', 'n_tokens_mistral': 899, 'n_tokens_neox': 840, 'n_words': 317, 'path': 'NB02.ipynb', 'repo_name': 'Akarvardar/VERSATILE-NEURAL-NETWORK-SOLVER', 'size': '3566'}