LoginSignup
2
2

More than 3 years have passed since last update.

デミング回帰(Demming Regression)

Last updated at Posted at 2019-07-08

はじめに

これは筆者の勉強まとめページですので、指摘しまくってい頂けると幸いです

デミング回帰

今回は https://qiita.com/raso0527/items/ba4bef9b1271428afbfc の記事のコードの損失関数を改良して学習をする

デミング回帰も線形回帰の一種で、損失関数を以下のように設定したもの

$$ loss = \frac{|t - (w・x + b)|}{\sqrt{w^2 + 1}} $$

これは数学IIで習った点と直線の距離の公式を変形した形になっていて、これを適用することにより、距離の大きさを誤差として極小値に近づけるよう学習をしていく。

点と直線の距離の公式
https://ja.wikipedia.org/wiki/%E7%82%B9%E3%81%A8%E7%9B%B4%E7%B7%9A%E3%81%AE%E8%B7%9D%E9%9B%A2

以下TensorFlowによるコード

demming_numerator = tf.abs(tf.subtract(y_target , tf.add(tf.matmul(x_data, A), b)))
demming_demoinator = tf.sqrt(tf.add(tf.square(A), 1))

loss = tf.reduce_mean(tf.truediv(demming_numerator, demming_demoinator))

Unknown-1.png

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2