FeedForward.cpp 655 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <Nodes/FeedForward.h>
  9. #include <Models/MultilayerPerceptron.h>
  10. namespace MachineLearning
  11. {
  12. AZ::VectorN FeedForward::In(INeuralNetworkPtr Model, AZ::VectorN Activations)
  13. {
  14. AZStd::unique_ptr<IInferenceContext> inferenceContext;
  15. inferenceContext.reset(Model->CreateInferenceContext());
  16. AZ::VectorN results = *Model->Forward(inferenceContext.get(), Activations);
  17. return results;
  18. }
  19. }