public static cnn_net cnnapplygrads(cnn_net net,cnn_opt opt){
        for(int l = 1;l<net.layers.length; l++){
            if(net.layers[l].type=='c'){
                for(int j=0;j<net.layers[l].a.length;j++){
                    for(int ii=0;ii<net.layers[l-1].a.length;ii++){
                        net.layers[l].k[ii][j] = util.diff(net.layers[l].k[ii][j], util.multiply(net.layers[l].dk[ii][j],opt.alpha));
                    }
                    net.layers[l].b[j] = net.layers[l].b[j] - net.layers[l].db[j]*opt.alpha;
                }
            }
        }
        net.ffW = util.diff(net.ffW,util.multiply(net.dffW,opt.alpha));
        net.ffb = util.diff(net.ffb,util.multiply(net.dffb,opt.alpha));
        return net;
    }