def parseParams(w,D,K):

    cnt = 0
    W01 = w[:D*nh].reshape((D,nh))
    cnt += D*nh
    b1 = w[cnt:cnt+nh].reshape((1,nh))
    cnt += nh

    W12 = w[cnt:cnt+nh*nh].reshape((nh,nh))
    cnt += nh*nh
    b2 = w[cnt:cnt+nh].reshape((1,nh))
    cnt += nh

    W23 = w[cnt:cnt+nh*K].reshape((nh,K))
    cnt += nh*K
    b3 = w[cnt:cnt+K].reshape((1,K))
    cnt += K

    if (cnt != w.size):
        print 'Error: wrong param size'
        exit()