import tensorflow as tf

        l3=tf.matmul(l2, self.w3)+self.b3
        l3=tf.nn.relu(l3)
        out=tf.matmul(l3, self.w4)+self.b4
        return out
    
    def valid_inference(self,images):
        images=tf.cast(images,tf.float32)/255.0
        l1 = tf.matmul(images, self.w1)+self.b1
        l1=tf.nn.relu(l1)
        l2 = tf.matmul(l1, self.w2)+self.b2
        l2=tf.nn.relu(l2)
        l3=tf.matmul(l2, self.w3)+self.b3
        l3=tf.nn.relu(l3)
        out=tf.matmul(l3, self.w4)+self.b4
        return out
    
    def softmax_loss(self,predicts,labels):
        predicts=tf.nn.softmax(predicts)
        labels=tf.one_hot(labels,classnum)
        loss=-tf.reduce_sum(labels*tf.log(predicts))
        return loss

    def optimer(self,loss,lr=0.001):
        train_step=tf.train.GradientDescentOptimizer(lr).minimize(loss)
