You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_cnnsketch2imageretrieval.m
    path of file: ./repos/cnnimageretrieval/examples
    
    the code of the file until where you have to start completion: % TEST_CNNSKETCH2IMAGERETRIEV
    
function for desc extraction
if ~use_ms
    descfun = @(x, y, z) cnn_vecms_sketch (x, y, z, 1, use_mirror);
else
    descfun = @(x, y, z) cnn_vecms_sketch (x, y, z, [1, 1/sqrt(2), sqrt(2), 1/2, 2], use_mirror);
end

%---------------------------------------------------------------------
% Testing
%---------------------------------------------------------------------
[~, network_name, ~] = fileparts(network_file);
fprintf('>> %s: Evaluating CNN image retrieval...\n', network_name);

% Load pre-trained edge detector
fprintf('>> Loading Dollar edge detector toolbox and model...\n');
emodel = load_edgedetector(data_root);

% Load pre-trained CNN network
fprintf('>> Loading CNN model...\n');
load(network_file);
net = dagnn.DagNN.loadobj(net);

% prepare GPUs if necessary
numGpus = numel(use_gpu);
if numGpus, fprintf('>> Preparing GPU(s)...\n'); end