-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmlp.py
More file actions
29 lines (23 loc) · 705 Bytes
/
mlp.py
File metadata and controls
29 lines (23 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pandas as pd
import numpy as np
__author__ = "Femi"
__version__ = "1"
__status__ = "starting"
class mlp():
"""Implementation of the autonomous neural network algorithm"""
import pandas as pd
import numpy as np
def __init__(self,data,layers):
self.data = data
self.layers = layers
def softmax(self):
np.exp()
def relu(self):
def sigmoid(self,outputs):
temp = outputs -outputs.max()
if len(self.targets.columns) >1:
return (np.exp(temp).T.divide(np.exp(temp).sum(axis = 1))).T
else:
pos = np.exp(temp)/(1+np.exp(temp))
neg = 1/(1+np.exp(temp))
return pd.DataFrame(pos)