function y = activate ( x, W, b )

%*****************************************************************************80
%
%% activate() evaluates the sigmoid function y = sigmoid(W*x + b).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 July 2022
%
%  Author:
%
%    Catherine Higham, Desmond Higham
%    Modifications by John Burkardt.
%
%  Reference:
%
%    Catherine Higham, Desmond Higham,
%    Deep Learning: An introduction for applied mathematicians,
%    SIAM Review,
%    Volume 61, Number 4, pages 860-891,
%    November 2019.
%
%  Input:
%
%    x(*): the input vector.
%
%    W(*): the weights.
%
%    b(*): the shifts.
%
%  Output:
%
%    y(*): the output vector.
%
  y = 1.0 ./ ( 1.0 + exp ( - ( W * x + b ) ) );

  return
end

