| /** |
| * 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.NonLinearActivations.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.LeakyReLU; |
| import org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.NonLinearActivationsPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Leaky Re LU</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.impl.LeakyReLUImpl#getNegative_slope <em>Negative slope</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class LeakyReLUImpl extends Nonlinear_activations_weightedsumnonlinearity_1Impl implements LeakyReLU { |
| /** |
| * The default value of the '{@link #getNegative_slope() <em>Negative slope</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNegative_slope() |
| * @generated |
| * @ordered |
| */ |
| protected static final double NEGATIVE_SLOPE_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getNegative_slope() <em>Negative slope</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNegative_slope() |
| * @generated |
| * @ordered |
| */ |
| protected double negative_slope = NEGATIVE_SLOPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LeakyReLUImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return NonLinearActivationsPackage.Literals.LEAKY_RE_LU; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public double getNegative_slope() { |
| return negative_slope; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setNegative_slope(double newNegative_slope) { |
| double oldNegative_slope = negative_slope; |
| negative_slope = newNegative_slope; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NonLinearActivationsPackage.LEAKY_RE_LU__NEGATIVE_SLOPE, oldNegative_slope, negative_slope)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case NonLinearActivationsPackage.LEAKY_RE_LU__NEGATIVE_SLOPE: |
| return getNegative_slope(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case NonLinearActivationsPackage.LEAKY_RE_LU__NEGATIVE_SLOPE: |
| setNegative_slope((Double)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case NonLinearActivationsPackage.LEAKY_RE_LU__NEGATIVE_SLOPE: |
| setNegative_slope(NEGATIVE_SLOPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case NonLinearActivationsPackage.LEAKY_RE_LU__NEGATIVE_SLOPE: |
| return negative_slope != NEGATIVE_SLOPE_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (negative_slope: "); //$NON-NLS-1$ |
| result.append(negative_slope); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //LeakyReLUImpl |