CreateModel.cpp 845 B

12345678910111213141516171819202122232425
  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/CreateModel.h>
  9. #include <Models/MultilayerPerceptron.h>
  10. namespace MachineLearning
  11. {
  12. INeuralNetworkPtr CreateModel::In(AZStd::size_t Inputneurons, AZStd::size_t Outputneurons, MachineLearning::HiddenLayerParams Hiddenlayers)
  13. {
  14. INeuralNetworkPtr result = AZStd::make_unique<MultilayerPerceptron>(Inputneurons);
  15. MultilayerPerceptron* modelPtr = static_cast<MultilayerPerceptron*>(result.get());
  16. for (AZStd::size_t layerSize : Hiddenlayers)
  17. {
  18. modelPtr->AddLayer(layerSize);
  19. }
  20. modelPtr->AddLayer(Outputneurons);
  21. return result;
  22. }
  23. }