Saturday, November 12, 2016

Udacity talk 1, Tony Fadell

2016-6-1. Tony Fadell is the father of ipod, founder of Nest.
Sebastian Thrun: Is it possible to find fulfillment working for a company or found your own company being CEO brings more?
Tony Fadell: Fulfillment is in the eye of beholder. You have to look for what you’re trying to learn. you need to set your own goals whether it’s as a startup as an independent or inside a big company.
The big thing that I asked when I interview people: what do you want to learn when you come here? Not what can you do for me. What do you want to learn? Because if you are always trying to learn then I know you’re trying to improve yourself and therefor you’re going to help the company improve as well.
Sebastian : How do you pick a candidate in the interview? How do you assess for the people really willing to learn
Tony: The other thing I ask is about their background so I go through their resume or any even if they don’t have experience. How did you pick your major? How did you discover what you wanted to do, what you really want to know? How did you know when you wanted to become an engineer or a doctor? I always want to see that insight. Do they understand what their gut is telling when they articulate that and then understand if they are really about pleasing you or trying to challenge themselves and get better. so you have to really listen closely.
S: you wanna be open to learning, open to failure.
T: Absolutely. We don’t learn to walk when we don’t walk out of the room. We have to learn everything in this failure on the way and you have to understand those moments of adversity and those moments of triumph, and how those people dealt with it. That’s the way I can assess.
We are adaptable creatures. we can learn all kinds of things if we want to learn.
Every single place you go there’s always something you can learn. You just have to be tuned into it and so yeah I learned a lot of great things in Apple. But at the end of the day, it boiled down to tenacity the people you know and things you need through your experiences. You can’t build a new company without understanding yourself but also knowing a network of people who can help you build. Most company is not just one person. It is a group of people. You need to have a network of people to help you and empower them to help you.
S: what is the rule for you to add a new feature?
T: First you have to segment out: are you a business to business product(service), or you’re business to consumer product. Very different things. company has very specific requirements and customer has very limited amount of requirement.
In General Magic we spent 4 years building something because we thought we needed every single feature. general magic lost a billion dollars and was one of the biggest failures in Silicon valley, because we put too many features in and it took 4 hours to explain what the product was. People have very limited time. You only have 3 or 4 amazing things to tell people.
Remote control is an example of Over design.
In the early days, we were trying to impress the person next to us. I am trying to say that I’m gonna make something so cool to impress them. You are doing something for someone who really understands and it gets really geeky. What your job as a great engineering designer is to not make things for the engineer next to you, but it’s to make for the common person who doesn’t understand the technology. Also, the product is empowering that person who buy the product a superpower. you make it so simple for them. They use it and feel like they have a new superpower they’ve never had.
S: how to say no if I want to add a new button.
T: there are data-driven decision, and opinion-based decision. the previous one is easier to look, and the later only takes 1 or 2 person to take care.
S: how do you learn from your failure?
… Your brain doesn’t come from the superficial success but from the learning success.
S: how do you convert from ipod to thermostat
T: frustration
T: I am chasing the passion, the thing that I really want to fix, that I thought was meaningful.
Don’t point to the market size. Point to the impact it could have as you do it right.
S: How do you do market research and something that doesn’t have a market yet?
T: You have to start with the idea what are you changing, and you have to take bold steps in terms of making something and trying it.
S: When I grow up in German, my professor never ever ask a question. They are supposed to know everything.
T: I went to 12 different schools in 15 years. Every time I was always learning because I was always in a new environment. I never was a master of in my environment because it was always changing. you should never think you’re a master of in your environment. This is about staying beginners to know what kind of product you’re going to make.
There are 2 things. One is always question. If you always question that means you’re curious, you have the potential to learn. The other one is just keep trying, keep listening ,keep learning, keep applying knowledge.

Emotional intelligence vs STEM: which one is essential to innovation

Emotional intelligence vs STEM: which one is essential to innovation?

it’s important to step back and look at whether our children, the innovators of the future, are gaining social and emotional skills — like sensitivity, empathy, social mindfulness, teamwork and an ability to imagine very different life experiences — in elementary and middle school. These are the interpersonal essentials for innovation, the precursors and prerequisites for harnessing outside-the-box thinking on behalf of others, and they’re just as important as math, science and technology training.
Think about some of the specific non-cognitive skills and attributes that lead to successful innovations — an insightful understanding of the end-user; collaborative connections with colleagues on an integrated design; and a true openness to the surrounding world. In the end, as I’ve learned through the Committee for Children, which is helping youngsters develop vital social and emotional skills, awareness counts as much as algorithms.
If I had to pick one skill that’s fundamental for innovators, however, it would be empathy, because of the way it allows us to see things from another person’s perspective. In other words, “How can I, as an innovator, help fill gaps and needs in people’s lives?”
There are other school-based skills that contribute to innovation. Thom Markham, a psychologist and school redesign consultant, feels that concepts need to be taught versus facts; creative and thinking tools ought to be employed; discovery must be rewarded; reflection should be encouraged; and teachers, themselves, have to establish and model an innovation ethos in the classroom.
One school of thought, for instance, says that to innovate effectively and generate a dynamic flow of valuable ideas, people need structure and methodologies, rather than conventional brainstorming sessions.
disruptive innovators generally possess five key skills, according to Gregersen and his colleagues, Jeff Dyer and Clayton Christensen:
  • Questioning: challenge the status quo and consider new possibilities
  • Observing: detect small details that suggest new ways of doing things
  • Networking: gain radically different perspectives from diverse backgrounds
  • Experimenting: relentlessly try out new experiences, take things apart and test new ideas
  • Associational thinking: draw connections from questions, problems or ideas from unrelated fields.

A/B test

A/B tests means that you can get data to make decisions rather than relying on intution or highest paying person’s opinion.
It’s not about how to implement an A/B test framework, it’s about how to design a task, choose metrics, and analyze the results.
John Lilly, CEO of Mozilla,
A/B testing is really useful for helping you climb to the peak of your burrent mountain, but isn’t so useful on deciding which mountain you want to be on.
  • new features
  • addition
  • different look
When Amazon first started doing personalized recommendation, they discovered people bought more stuff and actually had a significant increase in revenue.
For every 100 ms latency added to the page, they actually had a 1% decrease in revenue.

limitation

  • change aversion vs novelty effect
  • A/B testing can’t really tell you if you’re missing something.
  • can’t have immediate feedback for long-term, big decision
A/B test in other area:
  • agriculture
  • medicine: clinical trial
The key thing is you have a consistent response from your control and experiment group

customer funnel

users are trickling down the funnel:
page visits -> explore the site -> create account -> complete

binomial distribution

binomial distribution: In a sequence of n independent yes/no experiments, each has a success probability of p. Each experiment is also called Bernoulli experiment.
The probability function for k successes is Pr(k)=\frac{n!}{k!(n-k)!}p^{k}(1-p)^{n-k}
standard error SE=\sqrt{\frac{p(1-p)}{n}}
margin of error m=Z*SE
Z distribution is normal distribution with mean=0, sd=1: \phi (x)={\frac {e^{-{\frac {1}{ 2}}x^{2}}}{\sqrt {2\pi }}}
for a confidence interval of 95% in a 2-tailed test, each tail contains 2.5% distribution, corresponding to a z score of 1.96. So 1000 page visit with 100 clicks m=math.sqrt(0.10.9/1000)1.96=0.019, will have a confidence interval of 0.1-0.019~ 0.1+0.019

hypothesis testing

  • Null hypothesis : no difference
  • Alternative hypothesis

Friday, November 4, 2016

Intro to AI

finish 40% in 3 days, may come back if needed.

1 AI in general

  • Finace: making trading decisions
  • Web
  • Game
  • Robotics
  • medicine: diagnostic
  • languague translation

Terminology

  • Fully vs. Partially Observable
  • Deterministic vs. Stochastic
  • Discrete vs. Continuous
  • benign vs. Adversarial environment
AI as uncertainty management:
  • sensor limit
  • ignorance
  • stochastic

definition of a problem

  • initial state
  • actions(s)
  • result(s, a): return new state
  • GoalTest(s): return True/False
  • Path cost/step cost

2 finding the best route

Breath first search vs Depth first search

3 Beyes Network

complementary, independence,
conditional probability
joint probability
Bayes Rule
A is not directly observable, truth or fact of a cancer, B is directly obserbale, testing result of cancer. In Beyes Network (A—>B), It takes 1+2 parameters to specify. The core calculation depends on joint probability.
P(A|B)=\frac{P(B|A)*P(A)}{P(B)}
Posterior= Likelihood*Prioir/Marginal likelihood
P(B)=\sum_iP(B|i)*P(i)
Away effect:
indepedence does not imply conditional independence
e.g. S and R are independent, they are both necessary conditions to H. If we know H, then the existence of S or R will affect each other.
Screen Shot 2016-11-03 at 5.28.36 PM

4 Probabilistic inference

  • Evidence
  • Hidden
  • Query
Enumeration
variable elimination: joining table, sum out, rejection sampling, likelihood weighting.
Monty Hall problem: 1/3 vs 2/3

5 Machine learning

  • Bayes networks: reason with known models
  • machine learning: learn models from data
Stanley self-driving car: to see 200 meters far is a key factor to win the 2005 DAPRA race.
  • Classification: output is binary or a fixed number of classes
  • regression: output is continuous
Overfitting is a major source of poor performance of a machine learning algorithm.
spam detection: maximum likelihood, laplace smoothing.
Naive Bayes model, but not powerful enough to counter spam.d
logistic regression is slightly more complex than linear regression
gradient decent
perceptron algorithm
support vector machine: kernel trick
K nearest neighbors: nonparameter

6 Unsupervised learning

7 Representation with Logic

Agent design: reflex-based, goal-based, utility-based
complexity of environment
representation: logic
propositional logic:
  • V: or ;
  • ^: and
limitations
  • can’t handle uncertainty
  • can’t handle objects
  • no short cuts
first-order logic: relation to object

8 planning

problem solving: in deterministic and fully obserable environment, have starting point and end goal, find a path.
In your real life, you do your planning ahead of time, you have the complete goal, then without interacting with the world, without sensing it at all, start execute the path.
However, if people have gone out and blindfolk walk, they can never walk in a straight line, without any feedback from the environment.
In a stochastic environment, we must react to unexpected result. If the road is closed, we don’t know our state, which have partial observability.

19 Robotics

Robotics is the science of bridging the gap between sensor data and actions.
Kinematic state of a car: 3D of state space: xy plane + steer direction
Dynamic state of a car: 3+ foward veloctiy + raw rate
Kinematic state of an airplane, 6: x,y,z+ yaw rate+tilt+ roll
Dynamic state of an airplane:12

Monte Carlo Localization

particle filter
look at measurement, compute weight, sample, predict

office hour Q&A

Mahout: machine learning toolkit
sebastian: I never use toolkit. I’ve always coded straight in C++ or Java. More recently, as I aged, more in Matlab, which is really nice for rapid prototyping. It doesn’t give me the AI I want, but the tools to process the data, visualize data really quickly. So it’s fantastic to try out an idea.
next challenging?:
  • Object recognition.
  • Chess problem is only search problem.
  • perception problem. Do you understand the situation in fuzzy situations?
  • have an assistant. make everybody twice effective .
What hardware advancement expected to improve AI:
my 3-year old child is able to process huge amount of data. The way is: use existing computers and be really smart how to process massive amounts of data.
XX algorithms are hard to train?
Your laptop today was supercomputer of a a decade ago.
S: this is one of my frustration in scientific field, which in the past has looked into lots of small data sets, and very few have looked at very large data sets. As a result, the algorithms are mathematically beautiful and elegant, but they don’t scale.
I am pretty much self-taught. Look into the data first before applying any algorithm.
paths to professional in AI?
a lot of titles like computer scientist, game developer, research scientist, data scientist. No matter what the tools take, you’ve got to be able to get the job done.
The sexiest job in next 10 years will be statistician or machine learning person.

Wednesday, November 2, 2016

Intro to DevOps



To create value, first you need an idea for a product or service. But having an idea isn’t nearly enough. Customers don’t pay for just ideas. They want to see something that does what they need, a functioning product, a working service. An idea that you don’t actually ship is nothing but vapor water.
Classic organizational structure has strict borders between development, QA and operations. No matter how efficient the process within single departments, if there are high walls in between them, problems and inefficiencies creep in. All too often, there’s not a lot of communication between departments. The attitude might be, throw it over the wall it’s not our problem anymore, we met our deadline. But if the customer throw back, saying this is not I want. then a nasty cycle of blame can start:
  • lazy technical staff
  • unrealistic project deadline
  • inadequate server budget
  • sloppy coding practices
results in :
  • unhappy
  • slow and ineffective at delivery
  • can’t learn from failure (people blame each other!)
  • hard to make changes
  • operation problems stack up
In 2009, a grassroots movement of practitioners started, which known as DevOps.
The scariest phase in English language is we’ve always done it that way. With the advancement of hardware and software, the pace of innovation has only accelerated. Old methodologies simply can’t keep pace.
People just expect new features and fixes to happen quickly without disruption to their daily lives. A development process with a long detail design phase, and a planning phase, and then another long implementation phase is slow, inefficient and error-prone.
Agile development: constant feedback with an iterative approach allows to find problems between plan, code and test. But it’s not enough, like in deploy, operate.
One of agile’s key points: people > process> tools. If you have the best teams, but there’s no feedback or collaboration between teams, it can lead to a huge waste of time and resources.
hurry up and wait.
Everyone needs to have a shared view on what the current situation is. What are the goals? shared input generally creates shared responsibility and ownership. People are willing to work together if their thoughts and opinions are being heard. It’s important to have a shared view and identify and eliminate bottlenecks. The bottlenecks can be inside or between department. It’s not really important as long as they’re being addressed. It’s also important to have shared benefits among them. You can’t improve what you can’t measure.

roles and perspectives

Developer role: implement feature requests, fix bugs. feature-oriented. Building new features might be dependent on exploring new technologies or approaches that have not been used before. take new risks.
Operations people: run services. maintain services, troubleshooting/diagnosis. stability-oriented.usually invisible to the company, when everything works fine. Ops is noticed when something doesn’t work.
Conflicting interests.
  • Dev can feel like ops is blocking their work by not providing resources fast enough or not being supportive of new cutting edge tech.
  • Ops can feel like devs are being irresponsible and reckless and just implement new features without thinking about performance and security.
  • Product managers may be even more feature oriented than devs.
  • Security team more in the fear of introducing new, unknown vulnerabilities.
  • business managers: cost-benefit.

prepare development environment

brew install packer
git clone https://github.com/jychstar/devops-intro-project.git devops
follow README.md in the repo.
  • Run packer build -only=virtualbox-iso application-server.json It took me 3 hours to finish this step.
  • Run cd virtualbox
  • Run vagrant box add ubuntu-14.04.4-server-amd64-appserver_virtualbox.box --name devops-appserver
  • Run vagrant up
  • Run vagrant ssh to connect to the server
the most popular cloud providers that have free trials:
  • Google Cloud Platform
  • Amazon Web Services
  • Microsoft Azure.

problems

  1. When I in lesson 2 “using the image locally”, run vagrant up could not get through.
  2. In lesson 2”choose a cloud provider”, I could not follow through.
  3. In lesson 3” quiz: setting up Jenkins”, this is a following task

packer

packer can create golden images for different build targets, like VirtualBox and VMware or use on your workstation, also for cloud provider like AWS.
A template is a JSON file that defines one or more builds by configuring the various components of Packer. Packer use these information to create multiple machine images.
  • variables
  • builders
  • provisioners
  • post-processors

continuous integration

Jenkins

Monday, October 31, 2016

Deep learning, MIT intro

www.deeplearningbook.org
Early days of AI solved problems difficult for human but relative straightforward for computers, which can be described by a list of formal, mathematical rules. The true challenge to AI proved to be solving tasks that are easy for people to perform but hard for people to describe formally, problems we solve intuitively, that feel automatic, like recognizing spoken words or faces in images.
Deep learning is a solution to these more intuitive problems, which allow computers to learn from experience and understand the world in terms of a hierarchy of concepts.
Ironically, abstract and formal tasks, while mentally difficult for a human, are among the easiest for a computer.
A person’s everyday life requires an immense amount of knowledge about the world. Much of this knowledge is subjective and intuitive, and therefore difficult to articulate in a formal way. So one of the key challenge in AI is how to formalize this informal knowledge.
Simple machine learning algorithms depends heavily on the representation of the data, which is known as features.
For many tasks, it’s difficult to know what feature should be extracted. The approach is known as representation learning.
The main reason for the diminished role of neuroscience in deep learning research today is that we simply do not have enough information about the brain to use it as a guide.

my comment

I will make a stop of this book here due to the time constraint. My largest gain in this introduction is the awareness of informal knowledge. This reminds me that there are so many things that a school education failed to teach (at least at this moment) but are vital to a human’s life. These knowledges include emotional intelligent, time management, marriage fitness, culture shock, spiritual growth, etc. Unfortunately, we usually regard them as common sense without a systematical understanding.

The deep learning approach shines some light on these understanding. We can always insert arbitrary hidden layers between what we have and what we want. These hidden layers serve as thought-provoking buffer which allow us for creative ideas without directly jumping into the conclusion. I will practice this method to draw some mind maps.

Why AlghaGo?

why alpha go is really such a big deal

Knight=bishop= 3 pawns, rook-5 pawns, queen= 9 pawns, king =$\infty$ pawns
The notionof value is crucial in computer chess. The goal is for the program to find a sequence of moves that maximizes the final vlaue of the program’s board position, no what what the opponent do.
Ideas like this(a pawn blocking the rook devalue the rook) depend on detailed knowledge of chess and were curcial to deep blue’s success.
What happends if you apply this strategy to Go? .. Top Go players use a lot of intuition in juding how good a particualr board position is. And it’s not immediately clear how to express this intuition in simple, well-defined systems like the valuation of chess pieces. In 2006, Monte Carlo tree search algorithms was introduced, based on a clever wayof randomly simulating games.But it still fell far short of human player.
The mechanics behind AlphaGo is published in Nature in Jan. 2016.
AlphaGo learned in 2 stages:
  1. AlphaGo was trained by 150 k games played by good human players(6~9 dan), and used an artificial neural network to find patterns in those games. It learned to predict with high probability what move a human player would take in any given position.
  2. Improve the neural network by repeatedly playing it against earlier version of itself, adjusting the network so it gradually improved its chance of winning.
The neural network is a very complicated mathematical model, with millions of parameters to tune. When the network learned, it kept making tiny adjustments to the parameters in the model, trying to find a way to make corresponding tiny improvements in its play. This sounds like a crazy strategy—repeatedly tiny tweaks to enormously complicated function. But if you do this for long enough, with enough computing power, the network gets pretty good. And here’s the strange thing: it gets good for reasons no one really understands, since the improvements are a consequence of billions of tiny adjustments made automatically.
However, the core idea is how to get a valuation of the position. While the valuation system of Deep Blue based on lots of detailed knowledge, Alphago did it by analyzing thousands of prior games and engaing in a lot of self-play. Alphago created a policy network through billions of tiny adjustments, and build a valuation system similar to a good player’s intuition abuout the value of different board positions.
However, neural network have drawbacks. It can be fooled. It needs too many training data than human players.