function [B_dataset,B_test,topkmap] = DPSH_nus_wide_demo(codelens)
    %% setting seeds
    rand('seed', 0);
    %% download dataset or 
    %% load the Dataset
    load data/NUS-WIDE/nus-wide.mat IAll LAll param;
    net = load('data/imagenet-vgg-f.mat');
    %% initialization
    maxIter = 250;
    eta = 100;
    lr = logspace(-2.5, -2.5, maxIter);
    net = net_structure(net, codelens);
    U = zeros(numel(param.indexTrain), codelens);
    B = zeros(numel(param.indexTrain), codelens);
    %% training
    for iter = 1: maxIter
        [net, U, B] = train(IAll(:, :, :, param.indexTrain), LAll(param.indexTrain, :), U, B, net, iter, lr(iter), eta);
    end
    %% testing
    [topkmap, B_dataset, B_test] = test_nus_wide(net, LAll(param.indexRetrieval, :), ...
        LAll(param.indexQuery, :), IAll(:, :, :, param.indexRetrieval), IAll(:, :, :, param.indexQuery));
    disp(['Top-5K mAP:']);
    disp(topkmap);
    save(['DPSH_NUS_WIDE_' num2str(codelens) 'bits.mat'],'B_dataset','B_test','topkmap');
end