[LibSVM] Support Vector Machine (SVM) 實驗
多媒體設計系統作業三是要我們實驗SVM,
老師給我們training.txt和testing.txt兩個檔案,
分別用來training和predicting。
多媒體設計系統作業三是要我們實驗SVM,
老師給我們training.txt和testing.txt兩個檔案,
分別用來training和predicting。
關於【Ray Tracing】是一門很值得研究的學問,
在實做過程我遇到幾個瓶頸:
遞迴、折射、反射、鏡射光、散射光等,
尤其是【遞迴】如果沒有清楚的腦袋,
很難將後四者給兜起來。
首先我們來看一條「主光線」如何遞迴:
從上學期就看到此Phong Reflection Model的公式,
但也只知道表面而無法完全理解其內涵,
短短的一行等式中隱含著一個光的世界,
這時候我就把焦點放在【鏡射光(Specular)】上頭。
Ray與Sphere和Plane的交點,
我參考WIKI的Line-sphere intersection和Line-plane intersection,
這【交點】相當重要,
因為是反射與折射時重要的參考點。
這次作業最大的難度就在於【反射】與【折射】的【遞迴】實做,
若沒有搞清楚折射和反射的公式,
必然無法做到想要的效果!
以下是我看了「Reflections and Refractions in Raytracing」論文所得到的結論:
3D的時候不好看出結果,
這次使用2D sample點和test點來實做。
這次直接使用原始資料來實做,
一共有3個class,
每個class有10個sample,
而sample為3維(x1,x2,x3),
test point有4個。
總算知道【馬氏距離】的意義,
加上實際操作MATLAB來驗證理論,
真正瞭然於心。
話說MATLAB真是一個強大的工具呢!
Mahalanobis distance
From WiKi (http://en.wikipedia.org/wiki/Mahalanobis_distance)
In statistics, Mahalanobis distance is a distance measure introduced by P. C. Mahalanobis in 1936. It is based on correlations between variables by which different patterns can be identified and analyzed. It is a useful way of determining similarity of an unknown sample set to a known one. It differs from Euclidean distance in that it takes into account the correlations of the data set and is scale-invariant. In other words, it is a multivariate effect size.
Definition
Formally, the Mahalanobis distance of a multivariate vector
from a group of values with mean
and covariance matrix S is defined as:![]()
有關透視投影的概念,簡單來說就是同樣的物體,放在離眼睛較近的地方,物體成像看起來比較大,若放在離眼睛較遠的地方,物體成像看起來就比較小。在畫家手中的透視投影還有分一點、兩點、三點透視,這部份可參考:透視投影 (Perspective Projection)。
HappyMan・迴響