| /** |
| * Copyright (c) 2020 CEA LIST |
| * |
| * All rights reserved. This program and the accompanying materials are |
| * made available under the terms of the Eclipse Public License v2.0 which |
| * accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| */ |
| package org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.impl; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EPackage; |
| |
| import org.eclipse.emf.ecore.impl.EFactoryImpl; |
| |
| import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.*; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class Loss_functionsFactoryImpl extends EFactoryImpl implements Loss_functionsFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static Loss_functionsFactory init() { |
| try { |
| Loss_functionsFactory theLoss_functionsFactory = (Loss_functionsFactory)EPackage.Registry.INSTANCE.getEFactory(Loss_functionsPackage.eNS_URI); |
| if (theLoss_functionsFactory != null) { |
| return theLoss_functionsFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new Loss_functionsFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Loss_functionsFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case Loss_functionsPackage.L1_LOSS: return createL1Loss(); |
| case Loss_functionsPackage.MSE_LOSS: return createMSELoss(); |
| case Loss_functionsPackage.CTC_LOSS: return createCTCLoss(); |
| case Loss_functionsPackage.KL_DIV_LOSS: return createKLDivLoss(); |
| case Loss_functionsPackage.MULTI_LABEL_MARGIN_LOSS: return createMultiLabelMarginLoss(); |
| case Loss_functionsPackage.LOSS_FUNCTIONS_11: return createLoss_functions_1_1(); |
| case Loss_functionsPackage.LOSS_FUNCTIONS_12: return createLoss_functions_1_2(); |
| case Loss_functionsPackage.COSINE_EMBEDDING_LOSS: return createCosineEmbeddingLoss(); |
| case Loss_functionsPackage.MARGIN_RANKING_LOSS: return createMarginRankingLoss(); |
| case Loss_functionsPackage.HINGE_EMBEDDING_LOSS: return createHingeEmbeddingLoss(); |
| case Loss_functionsPackage.BCE_LOSS: return createBCELoss(); |
| case Loss_functionsPackage.MULTI_MARGIN_LOSS: return createMultiMarginLoss(); |
| case Loss_functionsPackage.TRIPLET_MARGIN_LOSS: return createTripletMarginLoss(); |
| case Loss_functionsPackage.CROSS_ENTROPY_LOSS: return createCrossEntropyLoss(); |
| case Loss_functionsPackage.NLL_LOSS: return createNLLLoss(); |
| case Loss_functionsPackage.POISSON_NLL_LOSS: return createPoissonNLLLoss(); |
| case Loss_functionsPackage.BCE_WITH_LOGITS_LOSS: return createBCEWithLogitsLoss(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public L1Loss createL1Loss() { |
| L1LossImpl l1Loss = new L1LossImpl(); |
| return l1Loss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public MSELoss createMSELoss() { |
| MSELossImpl mseLoss = new MSELossImpl(); |
| return mseLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public CTCLoss createCTCLoss() { |
| CTCLossImpl ctcLoss = new CTCLossImpl(); |
| return ctcLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public KLDivLoss createKLDivLoss() { |
| KLDivLossImpl klDivLoss = new KLDivLossImpl(); |
| return klDivLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public MultiLabelMarginLoss createMultiLabelMarginLoss() { |
| MultiLabelMarginLossImpl multiLabelMarginLoss = new MultiLabelMarginLossImpl(); |
| return multiLabelMarginLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Loss_functions_1_1 createLoss_functions_1_1() { |
| Loss_functions_1_1Impl loss_functions_1_1 = new Loss_functions_1_1Impl(); |
| return loss_functions_1_1; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Loss_functions_1_2 createLoss_functions_1_2() { |
| Loss_functions_1_2Impl loss_functions_1_2 = new Loss_functions_1_2Impl(); |
| return loss_functions_1_2; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public CosineEmbeddingLoss createCosineEmbeddingLoss() { |
| CosineEmbeddingLossImpl cosineEmbeddingLoss = new CosineEmbeddingLossImpl(); |
| return cosineEmbeddingLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public MarginRankingLoss createMarginRankingLoss() { |
| MarginRankingLossImpl marginRankingLoss = new MarginRankingLossImpl(); |
| return marginRankingLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public HingeEmbeddingLoss createHingeEmbeddingLoss() { |
| HingeEmbeddingLossImpl hingeEmbeddingLoss = new HingeEmbeddingLossImpl(); |
| return hingeEmbeddingLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public BCELoss createBCELoss() { |
| BCELossImpl bceLoss = new BCELossImpl(); |
| return bceLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public MultiMarginLoss createMultiMarginLoss() { |
| MultiMarginLossImpl multiMarginLoss = new MultiMarginLossImpl(); |
| return multiMarginLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public TripletMarginLoss createTripletMarginLoss() { |
| TripletMarginLossImpl tripletMarginLoss = new TripletMarginLossImpl(); |
| return tripletMarginLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public CrossEntropyLoss createCrossEntropyLoss() { |
| CrossEntropyLossImpl crossEntropyLoss = new CrossEntropyLossImpl(); |
| return crossEntropyLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NLLLoss createNLLLoss() { |
| NLLLossImpl nllLoss = new NLLLossImpl(); |
| return nllLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public PoissonNLLLoss createPoissonNLLLoss() { |
| PoissonNLLLossImpl poissonNLLLoss = new PoissonNLLLossImpl(); |
| return poissonNLLLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public BCEWithLogitsLoss createBCEWithLogitsLoss() { |
| BCEWithLogitsLossImpl bceWithLogitsLoss = new BCEWithLogitsLossImpl(); |
| return bceWithLogitsLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Loss_functionsPackage getLoss_functionsPackage() { |
| return (Loss_functionsPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static Loss_functionsPackage getPackage() { |
| return Loss_functionsPackage.eINSTANCE; |
| } |
| |
| } //Loss_functionsFactoryImpl |