I am new and a very beginner of coding. Currently, I am planing to program an autoencoder for the features reduction by myself. Although I spent most of my time solving the error I got by taking a look at web sites and books, I am still suffering from debugging.
dtypes is float64(5) and Row and column is (37310, 5).
Any comments should be helpful. Thank you in advance!!
data1 = pd.read_csv("Omics small data3.csv")
df = pd.DataFrame(data1)
KA = df.as_matrix()
KA.shape
KA = Variable(np.array([37310, 5]).astype(np.float))
X = np.array(KA)
class MyAE(Chain):
def __init__(self):
super(MyAE, self).__init__(
l1=L.Linear(500,100),
l2=L.Linear(100,500),
)
def __call__(self,x):
bv = self.fwd(x)
return F.mean_squared_error(bv, x)
def fwd(self,x):
h1 = (self.l1(x))
h2 = F.sigmoid(self.l2(h1))
bv = self.l3(h2)
return bv
model = MyAE()
optimizer = optimizers.SGD()
optimizer.setup(model)
n = 150
bs = 30
for i in range(0, n, bs):
x = Variable(X)
model.cleargrads()
loss = model(x)
loss.backword()
optimizer.updata()
import matplotlib.pyplot as plt
x = Variable(X)
y = F.sigmoid(model.l1(x))
plt.scatter(x, y)