ex1.m

implement linear regression and get to see it work on data.

  • Plot Data

ex1_plotting_data.png

  • Plot the linear fit

ex1_plot_linear_regression.png

  • Visualizing J(theta0, theta1) by surf

ex1_visualizing_J_theta0_theta1_by_surf.png

  • Visualizing J(theta0, theta1) by contour

ex1_visualizing_J_theta0_theta1_by_contour.png

ex1_multi.m

  • Plot the convergence graph with different learning rates

ex1_multi_plot_the_convergence_graph.png

Troubleshoot:

1 . When you run the submit script, if you are seeing error messages that contain any of these phrases…

urlread, curl, urlreadwrite, peer certificate, CA certificate, unsupported protocol, JSONparser

…here are some issues you can check.

Are you using Octave 4.0.0? You will need to install this. Follow the instructions in the readme.txt file. Restart Octave after installing the patch. There is a bug in the printf() function, it will be fixed in Octave 4.0.1. The error “JSONparser:invalidFormat: Outer level structure must be an object or an array” error is caused by this bug.

2 . What is the idea of mean normalization? Is it necessary?

yumi:

I think that feature scaling is to change the contours of the cost function from ellipse to circle to speed up the convergence. But mean normalization will only affect the center of the circle. So I don’t understand why we need to ensure that all the features centered around the same value.

Andy Timmons:

Yumi is right, it is in fact unneccesary. However, you get style points for having a well balanced equation.

What is at issue is that you use the same alpha for all equations. So, if you select alpha, you want it to be equally valid for all equations, hence the same range. As Tom Mosher said, centering your problem around zero is just what you do.

Its like taking a picture and putting the object in the middle of the frame. You can get the picture with the object to the left or right, but its just sloppy.

Applying the equation x-u/s for each parameter means that you dont have to think about what to do for each parameter, its a general equation that can be applied to all with out trying to think “how do I normalize and scale this column”, it helps in making a general program that works for all cases.

3 . Predicted price different when I use gradient descent method and normal equations

Because of error price equation. Hint: Normalizing data

plot

myPlot.png

subplot

mySubplot.png

imagesc

magicImagesc.png magicImagescWithColorbar.png magicImagescWithColorbarGray.png

figure

magicImagescInFigure1.png magicImagescGrayInFigure2.png

Troubleshoot:

When I print figure on OSX Yosemite, the graph is solid black.

Because

the gnuplot 5 bug:

  • http://savannah.gnu.org/bugs/?44458

reference:

  • http://stackoverflow.com/questions/28133022/octave-on-osx-yosemite-print-outputs-doc-but-graph-is-solid-black

solution:

  • downgrading to gunplot version 4.6.6

Speaker: Michael Kimmel

Michael Kimmel - Why gender equality is good for everyone - men inclued

So the black woman says to the white woman, “When you wake up in the morning and you look in the mirror, what do you see?” And the white woman said, “I see a woman.” And the black woman said, “You see, that’s the problem for me. Because when I wake up in the morning and I look in the mirror,” she said, “I see a black woman. To me, race is visible. But to you, race is invisible. You don’t see it.”

“That’s how privilege works. Privilege is invisible to those who have it.”

So making gender visible to men is the first step to engaging men to support gender equality.

“I have just one question for you guys, and it’s about the title of the show, ‘A Black Woman Stole My Job.’ Actually, it’s about one word in the title. I want to know about the word ‘my.’ Where did you get the idea it was your job? Why isn’t the title of the show, ‘A Black Woman Got the Job?’ or ‘A Black Woman Got A Job?’” Because without confronting men’s sense of entitlement, I don’t think we’ll ever understand why so many men resist gender equality.

Note:

0:11 I’m here to recruit men to support gender equality.

  • recruit v. 招募

0:35 Now, I wasn’t always a middle class white man. It all happened for me about 30 years ago when I was in graduate school, and a bunch of us graduate students got together one day, and we said, you know, there’s an explosion of writing and thinking in feminist theory, but there’s no courses yet. So we did what graduate students typically do in a situation like that. We said, OK, let’s have a study group. We’ll read a text, we’ll talk about it, we’ll have a potluck dinner.

  • feminist n/adj. 女權主義者(的)

  • potluck dinner

  • A potluck is a gathering of people where each person or group of people contributes a dish of food prepared by the person or the group, to be shared among the larger gathered group.

1:13 … this is going to sound very anachronistic now – the white woman said, “All women face the same oppression as women. All women are similarly situated in patriarchy, and therefore all women have a kind of intuitive solidarity or sisterhood.” …

  • anachronistic adj. 過時的;不合時宜的
  • oppression n. 壓迫
  • patriarchy n. 父權制;父系社會
  • intuitive adj. 直觀的
  • solidarity n. 團結

4:14 So I hope you all can see, this is what objectivity looks like.

  • objectivity n. 客觀性

4:35 Because if you are going to embody disembodied Western rationality, you need a signifier, and what could be a better signifier of disembodied Western rationality than a garment that at one end is a noose and the other end points to the genitals?

  • embody v. 使具體化
  • disembodied a. 脫離現實的
  • noose n. 套索
  • genital n. 生殖器

4:56 That is mind-body dualism right there.

  • dualism n. 二元論

5:12 … This results in a syndrome that I like to call ‘premature self-congratulation.’

  • syndrome n. 綜合症

7:26 Look, we think this is a level playing field, so any policy that tilts it even a little bit, we think, “Oh my God, water’s rushing uphill. It’s reverse discrimination against us.”

  • discrimination n. 歧視

7:36 So let me be very clear: white men in Europe and the United States are the beneficiaries of the single greatest affirmative action program in the history of the world. It is called “the history of the world.”

  • beneficiary n. 受惠者

8:49 … They have lower job turnover. …

  • turnover n. 營業額

9:36 … They expect their partners, their spouses, their wives, to work outside the home and be just as committed to their careers as they are.

  • spouse n.配偶

10:01 … When I was a lot younger, there was a riddle that was posed to us. Some of you may wince to remember this riddle. This riddle went something like this.

  • riddle n. 謎語

10:17

  • physician n. 內科醫師

12:15 And I’m going to propose something a little bit more radical, one word: “share.”

  • radical adj. 激進的

主要記錄當天黑客松開發的狀況與問題,做簡單的檢討與反思。

在偶然的機遇下參加了 2015/09/05 - 06 為期兩天,共 30 小時的 Akatsuki Hackthon 2015,好吧,其實已經鎖定很久了 xd

在學時期就聽過 Akatsuki 曉數碼公司對於遊戲與公司發展理念的演講

打從那一刻起,就對 Akatsuki 內部的公司文化有著特別的期盼、嚮往

到了當場果然不失所望,初見 Akatsuki 的工作環境,感覺是非常舒適、親切的

木質地板、吧台、明亮清潔的浴廁,而當時考慮到公司的隱私,所以不太敢亂拍照,畫面就留給大家想像囉

DSC_1457

(每隊參賽隊伍都有自己的小房間,裡面有白板、白板筆,適合團隊討論)

再來就回到作品開發的流程了

開發過程

今年的主題是製作一款手機遊戲,類型為 puzzle game,若不能編成 app 執行於 smart phone (無限定平台) 上 ,在分數統計時會斟酌扣分。

程式、素材準備

  • 基於 cocos2d-x 的自製開發框架
  • 源自 OpenGameArt.org 的音樂包
  • 自製人物素材

工具準備

  • 白板、白紙
  • 便條紙
  • git (bitbucket)
  • rasiberry pi + ip 分享器

環境準備

  • Java SDK (8u60)
  • Android SDK
  • Android NDK (10e)
  • ant 1.9.6
  • python 2.7

這次比賽裡,我在團隊裡擔任的是 Project Manager 的職位,主要負責:程式主要架構規劃、安排開發順序、時程控管。

11989202_1033753316648439_825788432_o.jpg

(記錄團隊討論時的創意發想)

對我來說,Project Manager 是一個很大的挑戰,原因在於自己對於多人協同開發的經驗與操作其實都還不熟練,更何況 Hackathon 的性質在於短時間內就要完成發想、規劃、實作、成品等過程,對於自己要主持這樣一個超強度的專案,可說是倍感壓力,不過自己就當作是一種磨練,接受挑戰囉。

DSC_1488

(利用白板書寫程式主要架構)

Note: 準備好環境

然後一剛開始就遇到狀況了 xd,由於先前我們都只開發 pc 遊戲而沒有準備 android 或 ios 的開發環境,起初我們花了快三個小時去處理環境,即使 cocos2d-x 本身是支援跨平台的,但那時因為專案設定上的不熟悉,導致編譯不斷出錯,後來只好先安排其中兩個人先去開發程式,留一個人專注處理環境,而之後都統一由架好環境的那個人輸出 apk 檔,所幸在下一個小時,我們終於有一台電腦能夠輸出 apk 檔,而遊戲主程式的開發也持續地進行。

DSC_1503

(一些小配備,rasiberry pi + ip 分享器 是要拿來自架 git server 用的,不過好在當天網路順暢就直接用現有的服務了)

然而每個人的開發環境沒有統一,卻導致之後開發的困難,譬如我們有一個暫停遊戲的功能頁面,在 windows 版本下是能夠正常運作、顯示,但在 android 版本下一旦觸發該功能就會導致程式閃退,最後由於這個頁面先前就已經花很多時間編寫,若再對它進行修復感覺不太符合成本,最後只能選擇放棄展示 “暫停遊戲” 的功能了。

Note: 建立團隊守則

原本以為已經有使用 git 對程式碼進行管理了,編譯的狀況應該就不會有什麼問題了吧,結果還是發生一堆小狀況,譬如有的是把無法編譯的程式碼推上來、有的忘記把專案會用到的圖片檔上傳上來、不同的人對同一個檔案的命名不一致、刪砍專案檔的某些欄位資訊導致整個專案無法編譯 … 等等,因此我想若要避免以上的情況發生,或許能透過團隊之間事先律定一套開發守則甚至是 SOP,養成良好的 coding 習慣,彼此互相提醒,免得又發生東漏西漏、遇到問題自己胡亂解決的狀況發生。

DSC_1496

(利用便條紙來實現開票、開 issue 的概念)

另外,保持團隊良好的狀況也是一大難題,雖然事先有想過是否要藉由統一規定成員休息、吃東西等時間,來確保隊員的精神狀況與開發進度,但又怕這樣的限制可能會適得其反,因此當時還是決定讓每個人自行規劃自己的休息時間,除非出現太誇張的舉動(ex. 吃披薩吃到忘記打 code)再去約束吧。

DSC_1490

(主辦貼心準備的豐盛宵夜)

Note: 保留足夠的測試時間

關於測試這一點,或許是我在這次比賽中最大的遺憾吧;當時因為距離成果發表只剩下最後的兩個小時,我就去準備投影片和講稿內容而沒有親自驗收,但事後想想其實這一階段的驗收和測試才是最重要的,而我們很不幸地就真的受到了懲罰,在 demo 的時候,我們的程式頻頻 crash ,不僅打亂了報告的節奏,也無法順利地展現出成品的特色。

當時或許是我對 develop 版本的成品太有自信,因此當組員們並沒有真正對程式進行測試,反而是還在繼續開發、增添新功能時,我沒有第一時間去阻止而終釀成了這悲劇。這也讓我反思了先前寫網站時總是迴避去寫測試檔,認為那耗時又沒有實際的輸出,怕會做白工的心態,如今可說是當頭棒喝了吧。(當然這不代表 Hackathon 的程式開發要寫測試檔,基本上還是沒時間啦)

DSC_1485

(挑燈夜戰,薯片相隨)

Note: 與成員確認 demo 的流程

從頭和成員們跑一次 demo 的流程,包括投影片播放、程式操作細節,確保大家都知道即將展示的內容並清楚自己的角色以及接下來的動作 ,避免搶台、搶戲的事情發生。

另外,自己特別想反省的是,別讓 demo 的過程變成自己的獨角戲、表演秀,必須顧及背後默默努力的團隊成員,在報告過程中適度介紹成員或讓成員親自參與部分的報告,即使這對簡報的結果並無太大的益處,但這樣的舉動可以讓成員們體會到自己的努力是被看到、重視的,或許就能讓成員的心理平衡許多。

DSC_1494

(團隊合影)

Note: 團隊就是一切

這段是想寫給團隊裡的各位,我們真的很努力,即使比賽沒有獲獎,但我們仍可以有自信自己的作品是最好的,且在比賽後還聽到你們討論著將來要怎麼改善這份程式並希望能夠上架,感覺很感動,這是一種不同於以往我接外包的感覺,那樣不管結果如何,盡心盡力去做就對了,而不是一定要得到什麼才行,我想這就是真正的享受,享受過程、享受編程的樂趣;那兩天裡,在我的虐待之下,想必讓你們吃了不少的苦頭,言語上也多有冒犯,但有時候緊急的情況下我只能用這種方式提醒你們,尤其是當我們經歷了二十幾個小時沒睡覺時,每個人那種接近恍惚卻還不斷 coding 的狀態,著實讓我非常的害怕,這也是我為何會不斷問大家,”你在幹麻?” “你做到哪了?” “你有沒有在聽?” 之類的話,且像有時候你們埋首寫一些有趣的功能時,我心裡都得猶豫該不該拉住你們,或是讓你們去實現自己的想法,因為那個功能對於整個程式可能不是很重要,何時該拉、何時該放,這樣的抉擇過程是我的難處,也是我將來會再去努力學習、改進的地方。

最後,比賽沒辦法獲獎的確讓我感到難過,因為你們已經努力一個月了,每次的開會和程式練習,大家都投入了很多時間和心力,我卻沒能把獎項帶給你們,對於一個 PM 來說,我失職了,然而你們並沒責怪我,反而讓我有點無法調適,有點尷尬,但回到家後,我把我們的作品放到手機裡,一遍又一遍地玩,每次 game over 時聽到那 ha ha 的嘲諷音效,就覺得好快樂;謝謝你們願意相信我的號令、忍耐我的任性,能跟你們一起完成作品是享受的,之後我會把自己準備得更好,到時後再讓我們一起去完成下一個作品,好嗎?

Akatsuki Hackathon 2015 Demo from 郁凱 黃

Puzzle game, written in C++, Cocos2d-x

cocos2d-x version: 3.6

Author: YU-KAI HUANG, 簡嘉慶, 陳映亦, 鄭鈞輿, 傅之謙