我可以在数学中找到激活函数列表,但在代码中找不到。因此,我想如果应该有一个列表,那么这将是代码中此列表的正确位置。从以下2个链接中的算法翻译开始:https : //en.wikipedia.org/wiki/Activation_function https://stats.stackexchange.com/questions/115258/comprehensive-list-of-activation-functions-in神经网络的利弊
我们的目标是拥有一个激活类(带有函数及其派生类),并且可以通过UI轻松访问。
编辑:我的尝试
using UnityEngine;
using System.Collections;
using System;
///<summary>
///Activation Functions from:
///https://en.wikipedia.org/wiki/Activation_function
///https://stats.stackexchange.com/questions/115258/comprehensive-list-of-activation-functions-in-neural-networks-with-pros-cons
///D infront means the Deravitive of the function
///x is the input of one perceptron. a is the alpha value sometimes needed.
///</summary>
[System.Serializable]
public class Activation
{
public ActivationType activationType;
public Activation(ActivationType type)
{
activationType = type;
}
public double AFunction(double x)
{
switch(activationType)
{
case ActivationType.Identity:
return Identity(x);
case ActivationType.BinaryStep:
return BinaryStep(x);
case ActivationType.Logistic:
return Logistic(x);
case ActivationType.Tanh:
return …Run Code Online (Sandbox Code Playgroud) 我在android studio中制作了一个通知服务项目,在棒棒糖上运行完美.现在我正在尝试将它变成Unity 5的插件.但是一旦构建它就会在启动时不断崩溃......
AndroidManifest.xml中:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.techlab.samanthaplugin" >
<application
android:allowBackup="true"
android:label="SamanthaPlugin">
<activity
android:name="com.techlab.samanthaplugin.MainActivity"
android:label="SamanthaPlugin" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.techlab.samanthaplugin.NotificationService"
android:label="SamanthaPlugin"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
</application>
Run Code Online (Sandbox Code Playgroud)
NotificationService类:
package com.techlab.samanthaplugin;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
import android.util.Log;
import android.support.v4.content.LocalBroadcastManager;
public class NotificationService extends NotificationListenerService {
Context context;
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
}
@Override
public void onNotificationPosted(StatusBarNotification sbn) {
String …Run Code Online (Sandbox Code Playgroud) 我碰到一些不同的错误计算功能来进行反传:方误差函数从http://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example/
Error = Output(i) * (1 - Output(i)) * (Target(i) - Output(i))
Run Code Online (Sandbox Code Playgroud)
现在,我想知道还有多少,它对培训的影响有多大?
此外,由于我理解第二个例子使用了图层使用的激活函数的导数,第一个例子是否也以某种方式执行此操作?对于任何损失函数(如果还有更多),它会是真的吗?
最后,如何知道使用哪一个,何时使用?