• 検索結果がありません。

Adaptive-Network-Based Fuzzy Inference System ANFIS :

N/A
N/A
Protected

Academic year: 2021

シェア "Adaptive-Network-Based Fuzzy Inference System ANFIS :"

Copied!
24
0
0

読み込み中.... (全文を見る)

全文

(1)

ANFIS :

Adaptive-Network-Based Fuzzy Inference System

By Jyh-Shing Roger Jang

知的制御システム研究室資料

Jyh-Shing Roger Jang 、 ANFIS: Adaptive Network Based

Fuzzy Inference System

IEEE Trans. on Systems, Man and

Cybernetics, vol. 23, no.3, pp.665-685, May 1993.

(2)

背景と目的

• システム同定方法

1.伝統的な方法 例えば微分方程式

欠点:

ill-defined and uncertain systems

に対して同定は難しい

2.ファジィ同定 例えば Takagi-Sugeno 方法

欠点:

a. No standard method exist for transforming human knowledge into the rule base and database of a fuzzy inference system

b. No effective method for tuning the membership functions so as to minimize the output error measure or maximize performance index

ANFISを構築し、規定されてたデータ組に基づいて、パラメータを調整し

て、ファジィ

if-then

ルールベースを獲得する。

(3)

• Architecture

An adaptive network

学習規則

基本的な方法: 最急降下法 と 連鎖法則

ANFIS: Hybrid

学習規則

Premise part Consequent part

(4)

ANFIS

Layer 3: Normalized firing strengths

Ratio: , 1 , 2 .

2 1

+ =

=

i

i

i

w w

w w

Layer 4: node function

. 2 , 1 ),

4

= f = ( p x + q y + r i =

O

i

w

i i

w

i i i i

Layer 5: Summation

å w f

vectors parameter

consequent as

r q p

i

,

i

,

i

) (

Layer 2: Multiplication or T-norm operator Output of firing strengths :

. 2 , 1 ),

( )

( ´ =

=

Ai

x

Bi

y i

i

m m

w

. 2 , 1 ),

( )

(

, = x AND y i =

or w

i

m

Ai

m

Bi

Layer 1: node function Bell function

Gaussian function

i

i b

i A i

a c x x

] ) [(

1 ) 1 (

-

2

+

= m

] ) (

exp[

)

(

2

i A i

a c x x

i

- - m =

vectors parameter

premise as

c

b

a , , )

(

(5)

ANFIS

• Hybrid 学習規則

Reference

NN BP Algorithm

(6)

ANFIS

• Example

2 5 . 1 1

5 .

0

)

1 ( ) , ,

( x y z = + x + y

-

+ z

-

f

Data pairs are obtained from

3 inputs, 2 MFs, 8 rules

Training data set size: 216

Checking data set size: 125

(7)

ANFIS

• Result

a. Step size from 0.01 to 0.09

b. Training error (solid line) and checking error(dashed line)

(8)

Ill-defined problem

1

.問題に関する決定的な(

definitive

)定式化はない

There is no definitive formulation of the problem

2.問題に関するどんな定式化も非一貫性を含みうる

Any problem formulation may embody inconsistencies

3.問題の定式化は、解決策依存

Formulations of the problem are solution-dependent

4.解決策の提案は、問題理解の手段の一つである

Proposing solutions is a means of understanding the problem

5.問題に対する決定的な解決策はない

There is no definitive solution to the problem

By Nigel Cross, Engineering Design Methods

(9)

コマンドによる ANFIS

1. ANFIS とは

【名称】

適応ニューロファジィ推論システム

• Adaptive Neuro-Fuzzy Inference System

【目的】

制御実測データからファジィモデルを同定する

【方法】

与えられた入出力データから、二つの学習手法のうちどちらかを用いて メンバーシップの関数のパラメータ訓練を行う

【学習手法】

バックプロパゲーション最急降下法のみ

バックプロパゲーション最急降下法と最小二乗法を組み合わせたもの

・・・ のどちらかを選択

知的制御システム研究室資料

(2008

川名)

(10)

ANFIS の使用

【使用方法】

① ANFIS Editor GUI

②コマンドライン : anfis 関数

例題を用いて説明

例) 倒立振子制御の入出力データから 用いた(ファジィ)制御を同定する コマンドで関数を用いることにより 自由にプログラミング可能である。

応用の幅が広がる。

(11)

コマンドラインからの ANFIS 実行手順

Step1. データ収集ブロックの作成

Step2. 制御実行(制御の入出力データを保存)

Step3. 入出力データから訓練用データを設定

Step4. 初期FISモデルを設定

Step5. 学習方法を設定

Step6. 学習開始

Step7. 学習完了

(12)

Step1. データ収集ブロックの作成

• 制御の入出力データを保存するブロックを追 加

cart position

cart velocity cart position angle velocity

angle

fuz_CONToutput fuz_CONTinput Target Position -C-

(Mouse-Driven) Target Position

Sw itch

Mux Mux

Fuzzy Logic Controller 1

Constant

Cart & Pole Dynamics

kaw _animcp Animation

(13)

Step2. 制御実行(入出力データ収集)

x

n

制御を実行し、入出力データを保存

・サンプリングタイム

0.01s

・実行時間

20

・入出力データ

入力(

, , ,

4

個 出力(-10~10V)1個

2000

x & q q &

x

(14)

Step3. 訓練用データの設定

• 保存した入出力データから訓練用データを設定する

• trnData = [ input1, input2, … , output]

• N+1の行列

1:N : 入力データ N+1 : 出力データ

入力データ 出力データ

2000個

(15)

Step4. 初期 FIS モデルの設定

• 関数 genfis1 を使用し、 ANFIS のための初期菅野タイプ

のファジィ推論システム( FIS )を作成する

gaussmf gaussmf2 gbellmf sigmf dsigmf psigmf zmf pimf smf

n

fis = genfis1 ( trnData, numMFs, inputMF);

n

入力

– trnData : N+1(N:入力データ、1:出力データ)の行列

– numMFs : 各入力に関するメンバシップ関数の数を指定

– inputMF : 各入力に関するメンバシップ関数のタイプを指定

n

出力

– fis : 生成される各ルールは1出力のメンバシップ関数

(16)

Step4. 初期 FIS モデルの設定

• fis = genfis1 ( trn Data, numMFs, inputMF);

– numMFs = 2

– inputMF = ‘gbellmf‘ を指定

• 初期 FIS モデル

>>plotmf(fis,‘input’,1); >>gensurf(fis);

(17)

Step5. 学習方法の設定

• 関数 anfis の引数によって

– 学習方法

– 訓練回数 ・・・等

様々な設定ができる

(18)

Step5. 学習方法の設定

• [fismat1, trnError, ss, fismat2, chkError]

= ... anfis (trnData, fismat, trnOpt, dispOpt, chkData, method);

入力

– trnData

訓練データ

– fismat

入力

FIS

モデル

– trnOpt

訓練オプション指定のためのベクトル

(訓練回数; 訓練誤差の目標; 初期ステップサイズ; ステップサイズの減少率; ステップサイズの増加率;)

– dispOpt

表示オプション指定のためのベクトル

(一般的なANFIS情報; エラー; 各パラメータ更新時のステップサイズ; 最終結果;)

– chkData

各訓練での機能チェック用データ

– method

: 学習方法の選択

(デフォルト1は最小二乗推定とバックプロパゲーションの結合したハイブリッド法、0はバックプロパゲーション法)

出力

– fismat1

チューニングされた

FIS

モデル

– trnError

各訓練における訓練誤差(

FIS

出力と訓練データの出力との差)の平均二乗

根の配列

– Ss

: ステップサイズ

(19)

Step6. 学習開始

• 関数 anfis を使用し、学習を行う

• [ fismat1] = anfis ( trnData, fismat );

• 入力

– trnData : 訓練データ

– fismat : 入力 FIS モデル

• 出力

– fismat1 : チューニングされた FIS モデル

(20)

Step7. 学習完了 (1)

n 学習・チューニング後のFISモデル

>>plotmf(fismat1,‘input’,1); >>gensurf(fismat1);

【ファジィルール】 【ファジィ面】

(21)

Step7. 学習完了 (2)

n

学習用データを提供した元制御器のFISモデル(参考用)

>>plotmf(fismat1,‘input’,1); >>gensurf(fismat1);

【ファジィルール】 【ファジィ面】

(22)

結果(1)

• 元の制御器と同定した制御器の動作比較

・・・実測時と同様の目標値 (-1.5 と 1.5) のとき

0 2 4 6 8 10 12 14 16 18 20

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2

Cart position [m]

Target position

Cart position (元の制御器) Cart position (同定後の制御器)

(23)

結果(2)

• 元の制御器と同定した制御器の動作比較

・・・実測時と異なる目標値 (-1.0 と 1.0) のとき

0 2 4 6 8 10 12 14 16 18 20

-1.5 -1 -0.5 0 0.5 1 1.5

Time [sec]

Cart position [m]

Target position

Cart position (元の制御器) Cart position (同定後の制御器)

ANFISで同定した制御器は、元の制御器と同様、倒立維持に成功

-1

1

付近のデータが少ないために、挙動は異なる。

(24)

まとめ

• コマンドラインにて関数を用いて、ANFIS(適応ニューロファ ジィ推論システム)を実行した。

• 関数を用いることによりs-functionにて使用ができ、自由にプ ログラミングが可能であり、様々な応用ができる。

% a1go.m: mdl

を実行し、結果を

Workfile

へ格納する。

ANFISkaw_slcp

% a2go.m:

fuz_trnData = [fuz_CONTinput(1:2001,1) fuz_CONTinput(1:2001,2) fuz_CONTinput(1:2001,3) fuz_CONTinput(1:2001,4) fuz_CONToutput(1:2001)];

%訓練データ(最後の行は出力、それ以外の行は入力)

numMFs = 2; %メンバシップ関数の数 mfType = 'gbellmf'; %'trimf'; %メンバシップ関数の形

fuz_in_fismat = genfis1(fuz_trnData,numMFs,mfType); %データからFIS構造体(numMFsとmfType)を作成 figure;

subplot(4,1,1), plotmf(fuz_in_fismat,'input',1); %入力1のルールをプロット

subplot(4,1,2), plotmf(fuz_in_fismat,'input',2); %入力2のルールをプロット

subplot(4,1,3), plotmf(fuz_in_fismat,'input',3); %入力3のルールをプロット

subplot(4,1,4), plotmf(fuz_in_fismat,'input',4); %入力4のルールをプロット

参照

関連したドキュメント

3-path Rayleigh model Independent Rayleigh fading Delay time difference : 0.1ȝs Relative power: 0dB, -5dB, -10dB Maximum Doppler frequency: 10Hz. (nominal value) 3-path

Adaptive-Agent Simulation Analysis of a Simple Transportation Network, Proceedings of the Joint 2nd International Conference on Soft Computing and Intelligent Systems and

Joint Torque-velocity Pair Set (TVS): The set of generable joint torque and velocity at each joint, given by the operation range of the corresponding actuator, is named joint

Developed wear using conductive fabric. Power Supply Unit

The connection weights of the trained multilayer neural network are investigated in order to analyze feature extracted by the neural network in the learning process. Magnitude of

pair of ables whih provide power supply and om-.

This paper presents a data adaptive approach for the analysis of climate variability using bivariate empirical mode decomposition BEMD.. The time series of climate factors:

Based on the stability theory of fractional-order differential equations, Routh-Hurwitz stability condition, and by using linear control, simpler controllers are designed to