function [w, loss_history] = gradient_descent(X, y, w, num_iters, mu, reg_type, lambda);
% Funkcija koja vrsi algoritam gradijentnog spusta.

loss_history = zeros(num_iters, 1);
for i = 1:num_iters
    [loss, grad] = loss_function(X, y, w, reg_type, lambda);
    w = w - mu .* grad;
    loss_history(i) = loss;
end

end
