HW2 TA hours
TAs
ntu.mlta@gmail.com
Outline
Shell Scripts
Shell accepts your instruction or commands (usually in English) and pass it to kernel.
Shell Scripts
2. What is Shell Script?
… 把很多指令寫成一個檔案,可以一次做很多事情。
甚至是做判斷式或是迴圈。
Script Tutorial and Example
Passing Arguments
How to pass arguments to your srctipts or .py files?
/path/to/scriptname /path/to/data /path/to/output
$0 $1 $2
2. 在terminal或cmd中的輸入與.py中變數對應關係:
/path/to/pythonfile /path/to/data /path/to/output
sys.argv[0] sys.argv[1] sys.argv[2]
Passing Arguments
script:
python:
Passing Arguments
Let’s run…
PATH
Logistic Regression
Implementation:
Code Example:
Logistic Regression
If we let batch_size=25...
Logistic Regression
-
Gaussian Distribution-Training(mean)
Gaussian Distribution-Training(sigma)
Gaussian Distribution-Training(sigma)
Shared sigma:
Gaussian Distribution-predict
Gaussian Distribution-sigmoid
使用np.clip() 避免數值太小或太大而overflow
Generative model -Naive Bayes Classifier
code
HW2 TA hours
TAs
ntu.mlta@gmail.com
Outline
Shell Scripts
Shell accepts your instruction or commands (usually in English) and pass it to kernel.
Shell Scripts
2. What is Shell Script?
… 把很多指令寫成一個檔案,可以一次做很多事情。
甚至是做判斷式或是迴圈。
Script Tutorial and Example
Passing Arguments
How to pass arguments to your srctipts or .py files?
/path/to/scriptname /path/to/data /path/to/output
$0 $1 $2
2. 在terminal或cmd中的輸入與.py中變數對應關係:
/path/to/pythonfile /path/to/data /path/to/output
sys.argv[0] sys.argv[1] sys.argv[2]
Passing Arguments
script:
python:
Passing Arguments
Let’s run…
PATH
Logistic Regression
Implementation:
Code Example:
Logistic Regression
If we let batch_size=25...
Logistic Regression
-
Gaussian Distribution-Training(mean)
Gaussian Distribution-Training(sigma)
Gaussian Distribution-Training(sigma)
Shared sigma:
Gaussian Distribution-predict
Gaussian Distribution-sigmoid
使用np.clip() 避免數值太小或太大而overflow
Generative model -Naive Bayes Classifier
code