<jupyter_start><jupyter_text>Example of XOR gate using an MLP and MLP class Author: <NAME> <NAME>  Reference:<jupyter_code>import numpy as np
import datetime
import sys
sys.path.append("../")
from mlp import mlp<jupyter_output><empty_output><jupyter_text>Examples  Using sigmoid<jupyter_code>clf = mlp(seed=1, activation="sigmoid", max_iter=10000, 
          hidden_layer_size=4, alpha=0.1, momentum=0.9,tol=1e-3, weight_range=(-1,1), bias=True)
%time clf.example_run(show="static")<jupyter_output>Stopping by error at 3110<jupyter_text>Using tanh<jupyter_code>clf = mlp(seed=1, activation="tanh", max_iter=10000, 
          hidden_layer_size=4, alpha=0.1, momentum=0.9, tol=1e-3, weight_range=(-1,1), bias=True)
%time clf.example_run(show="static")<jupyter_output>Stopping by error at 43<jupyter_text>Using softplus<jupyter_code>clf = mlp(seed=1, activation="softplus", max_iter=10000, 
          hidden_layer_size=4, alpha=0.1, momentum=0.9, tol=1e-3, weight_range=(-1,1), bias=True)
%time clf.example_run(show="static")<jupyter_output>Stopping by error at 286<jupyter_text>Using linear (it doesn't work, and it shouldn't)<jupyter_code>clf = mlp(seed=1, activation="linear", max_iter=10000, 
          hidden_layer_size=4, alpha=0.1, momentum=0.1, tol=1e-3, weight_range=(-1,1), bias=True)
%time clf.example_run(show="static")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14727540500736377, 'fraction_numerical': 0.0508100147275405, 'mean_word_length': 7.137724550898204, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '489313', 'license': 'MIT', 'n_tokens_mistral': 571, 'n_tokens_neox': 538, 'n_words': 92, 'path': 'xor/xor.ipynb', 'repo_name': 'ithallojunior/sistemas_inteligentes1', 'size': '1375'}