Monday, December 4, 2017

DVD, Core Meteorology

A series of DVD, director: Ron Meyer. Runtime: 30 minutes.
For grade 7 - College

Atmosphere

It is the atmosphere that creates relatively constant daytime versus nighttime temperatures, like the temperatures found on the earth. In our solar system, no atmosphere means no possibility of life.
We live on the earth. More precisely, we live in the troposphere of the earth, like fish in the water.
The stratosphere is home to the jet stream. Also home to Ozone.
The atmosphere is a delicate dynamic balance. A balance absolutely critical for all life on the planet.
heat conduction: the pan doesn’t move.
Remarkably, the most important part of this story for us is that the troposphere is heated from the bottom to the top. In spite of being the furthest from the sun, the air closest to the ground is warmer than the air 5 miles closer to the sun.
The heat move around the atmosphere is called weather. All weather happens in the lower atmosphere.

weather

3 factor affect weather prediction:
  1. initial state has some gap information
  2. model is not perfect
  3. the principle of time and size

climate

Climate is a pattern over time.
Human is adapted to these stable climate patterns as well.

NG- Natural disasters

1993 Storm of the Century

3 different weather models predict different storm track.
No matter how well we can predict this, we can’t stop it from occurring. If we had control of it, the meteorologist would make more money than professional sports players make.
I may lose a few toes, not a big deal… you are in good spirit.

2004 Indian Ocean earthquake and tsunami

Earthquake is actually good to release earth’s internal energy. A solution is to create a small man-made earthquake to defuse a big one.
Experimenting with mother nature is a very difficult thing. We may trigger a bigger earthquake than the one we were trying to prevent.
Inducing quakes is an inexact science.
A 30 billion question: how often does a city like New Orleans get hit by a Category Five hurricane? Experiments show New Orleans is living in its borrowing time. A major hurricane is overdue.
Project Stormfury is trying to intervene the hurricane, but failed.
The benefit of a hurricane is redistributing heat in the atmosphere.

Tornado intercept

Tim Samra died in 2013 in Oklahoma, the first known death as a storm chaser.
Tim Samaras did not seem startled by the question from his love child, Matt Winter. “Matt,” he replied, “Kathy’s a strong woman. She understands this is my passion. And if something happened to me, she’d move on.”

Thursday, November 23, 2017

Robot ND, A4, Control, Deep Learning


I started a new job as Data Analyst this month. My journey in Udacity Nanodegree will pause for a while. Overall, the course material is of high quality and worth devoting more time to digest. Although I didn’t end up at exactly what I initially imagined, yet my mind has been significantly broadened with these up-to-date content.
This blog is a track record of how I made my career change during the past 18 months. Thank you, Blogspot.
There are too many things to say about deep learning. It is a black box. An accuracy below 99% is not that useful. It relies on huge labeled data, expensive GPU computing power, and complicated algorithms. Anyway, it is still in development and a lot of fun to learn!

control

Control engineering often referred to as simple controls, is a multidisciplinary topic with roots in engineering in applied mathematics.
The primary objective is to design systems so that the response to an input is a predictable and desirable output.
Virtually every organ in biological process in the body uses some form of control: body temperature, blood pressure, glucose, PH and even skeletal muscle reflexes all rely on feedback control systems.
two types of control:
  1. open loop control. no attempt is made to measure if the output actually is the desired response. wash machine. In early days, much of the control theory was developed for the chemical and material processing industries. It is better for highly predictable, non-safety critical system.
  2. closed loop control. Have a sensor to get feedback signal to the controller
97% of all regulatory controllers are PID.
PID is also called 3-knob controller: proportional, integral, derivative.

deep learning

instructors:
  • Luis Serrano
  • Kelvin Lwin @ NVIDIA
fully convolutional networks:
  1. replace dense layer with 1*1 convolutional layer
  2. up-sampling through the use of transposed convolutional layers
  3. skip connection, use information from multiple resolution scales.
The Quiz uses tensorflow 0.12.1, as checked by tf.VERSION
object detection models that can draw bounding box: YOLO, SSD
semantic semmentation can acheive at pixel level.

segmentation lab

This ipynb contains the core codes for the final project “follow me”.
pip install tensorflow==1.2.1  # 1.1.0 doesn't work
pip install socketIO-client
pip install transforms3d
pip install PyQt5
pip install pyqtgraph
git clone https://github.com/udacity/RoboND-Segmentation-Lab.git
The train folder has 4132 images and corresponding masks, each image is shape (256, 256, 3)
The validation folder has 1185 images.
Note:
  • A lot of scaffold codes in the utils folder, including assigning images folder as X and mask folder as y. All the difficult details have been handled by utils codes. Don’t treat it as a magic button. Come back to dig more.
  • The images have been reduced to 128*128 to expedite the computing.
  • 3 classes are background, hero and other people.
A simple model looks like this:
def fcn_model(inputs, num_classes): 
    # Add Encoder Blocks, using separable convolution layers
    output1 = SeparableConv2DKeras (filters=3, kernel_size=3, strides=1, padding='same', activation='relu')(inputs)
    output1 = layers.BatchNormalization()(output1)    
    # Add 1x1 Convolution layer using conv2d_batchnorm().
    output2 = layers.Conv2D(filters=3, kernel_size=1, strides=1, padding='same', activation='relu')(output1)
    output2 = layers.BatchNormalization()(output2) 
    # Add the same number of Decoder Blocks as Encoder 
    upsampled = BilinearUpSampling2D((2,2))(output2)
    output3 = layers.concatenate([upsampled, inputs])
    return layers.Conv2D(num_classes, 3, activation='softmax', padding='same')(output3)

project

‘README.md’ contains a lot of detailed instructions.

AWS setting

  • EC2
  • launch instance -> Community AMIs -> search Udacity robotics -> p2.xlarge,next, next, next,
  • security group. create new, source: my ip. Note: If you plan to connect a Jupyter notebook to your AWS instance you will need to add one connection rule. Specifically, you will need to add a custom TCP rule to allow port 8888. and set the source to My IP.
After launch
  • connect, pull out an instruction, refresh memory at http://www.yuchao.us/2017/03/aws-elastic-compute-cloud.html
  • my key is stored at ~/.ssh
  • replace root in ssh -i "MyKeyPair.pem" root@ec2-34-236-144-24.compute-1.amazonaws.com to ubuntu. success.
  • connect AWS instance$ jupyter notebook --ip='*' --port=8888 --no-browser
  • open browse, enter {IPv4 Public IP}:8888
  • go back to terminal for token/password
  • if quit, type “exit” in terminal
  • if stop instance temporarily, click actions -> instance state -> stop

simulator control

L: Turns the legend with the control information on and off
H: Enables and disables local control of the quad
WSAD/Arrows: Moves the quad around when local control is on
E/Q: Rotate the quad clockwise and counterclockwise respectively
Space/C: Increase and decrease the thrust of the quad when local control is on
Scroll wheel: Zooms the camera in and out
Right mouse button (drag): Rotates the camera around the quad
Right mouse button (click): Resets the camera
Middle mouse button: Toggle patrol and follow mode
G: Reset the quad orientation
F5: Cycle quality settings
/: Path display on/off
ESC: Exit to the main menu
Crtl-Q: Quit

execute the code

ros
cd RoboND-DeepLearning-Project/code
source activate RoboND
python preprocess_ims.py  # image preprocessing
python follower.py my_amazing_model.h5 # test in simulator

What to include in your submission

Achieve an accuracy of 40% (0.40) using the Intersection over Union IoU metric which is final_grade_score at the bottom of your notebook.
Use the Project Rubric to review the project. You must submit your project as a zip file. The submission must included:
  1. Your model_training.ipynb notebook that you have filled out.
  2. A HTML version of your model_training.ipynb notebook.
  3. Writeup report (md or pdf file) summarizing why you made the choices you did in building the network.
  4. Your model and weights file in the .h5 file format

first submission review

The project code is basically not started and report only consists of a few lines, so the project cannot be reviewed. I think you would be better served discussing with a mentor on Live Chat rather than making a submission here.
As for how to improve your model, there are two main things:
1) Need to add more layers. At the moment there is just 1 encoder, 1 1x1 convolution and 1 decoder. You ideally want 2-3 encoders and 2-3 decoders.
2) Need to add more filters to each layer. At the moment just using 3 for each layer, but should be higher than this. For example 32, 64, 128, etc.
Again I highly recommend having a discussion with a Live Chat mentor before your next submission. We can help you out, don’t worry! :udacious:

Tuesday, October 24, 2017

book, Lies my teacher told me

Note: I only finished reading the first 2 chapters. There are so many historical details that my brain is not ready to store. The key idea is that the winner tells the story to his favor. All the living human should be aware of that the history is not only about the glory heroine past, but also about the struggle and the brutal evolution. I read the 1st version. The 2nd version has included a few more textbooks and latest research.
lies my teacher told me, 1996, 2007
By James W.Loewen, whose Ph.D. in sociology from Harvard University is based on his research on Chinese Americans in Mississippi.
The book reflects Loewen’s belief that history should not be taught as straightforward facts and dates to memorize, but rather as analysis of the context and root causes of events. Loewen recommends that teachers use two or more textbooks, so that students may realize the contradictions and ask questions, such as, “Why do the authors present the material like this?”
Because textbooks employ such a godlike tone, it never occurs to most students to question them. “In retrospect, I ask myself, why didn’t I think to ask, e.g. who were the original inhabitants of the Americas, what was their life like, and how did it change when Columbus arrived. However, back then everything was presented as if it were the full picture, so I never thought to doubt that it was.”
sale figures are trade secrets.

1 handicapped by history: the process of Hero-making

Charles V. Willie
By idolizing those whom we honor, we do a disservice both to them and to ourselves.. we fail to recognize that we could go and do likewise.
The hidden history of Helen Keller advocate socialism and President Woodrow Wilson invaded South America.
Keller learned how the social class system controls people’s opportunities in life, sometimes determining even whether they can see.
I had once believed that we were all masters of our fate— that we could mold our lives into any form we pleased… But as I went more and more about the country I learned that I had spoken with assurance on a subject I knew little about. I forgot that I owed my success partly to the advantages of my birth and environment…
There are 3 great taboos in the textbook publishing: sex, religion, and social class. The notion that opportunity might be unequal in America is disliked by many textbook authors and teachers. Educators would much rather present Keller as a boring source of encouragement and inspiration to our young — if she can do it, you can do it!
A host of other reasons may help explain why textbooks omit troublesome facts:
  • pressure from the ruling class
  • pressure from textbook adoption committees
  • the wish to avoid ambiguities
  • a desire to shield children from harm or conflict
  • the perceived need to control children and avoid classroom disharmony
  • pressure to provide answers
We don’t want complicated icons. We seem to feel that a person like Helen Keller can be an inspiration only as long as she remains uncontroversial, one-dimensional.
Conclusions are not always pleasant. Most of us automatically shy away from conflict. We particularly seek to avoid conflict in the classroom.

1493

textbooks don’t tell:
  • advances in military technology.
  • social technology: bureaucracy, double-entry bookkeeping, mechanical printing
  • ideological: collect wealth and dominate other people is positively valued as the key means of winning esteem. Pursuit of wealth as a motive for coming to American. Authors believe that to have America explored and colonized for economic gain is somehow undignified.
  • readiness to embrace a new continent is the particular nature of European Christianity. evangelization
  • Europe’s recent success in taking over and exploiting various island societies.
Deep down, our culture encourages us to imagine that we are richer and more powerful because we’re smarter. We are smarter so “it’s natural” for one group to dominate another.
Most important, his purpose from the beginning was not mere exploration or even trade, but conquest and exploitation, for which he used religion as a rationale.
When Columbus was selling Queen Isabella on the wonders of the Americas, the Indians were well built and of quick intelligence. They have very good customs, and the king maintains a very marvelous state, of a style so orderly that it is a pleasure to see it, and they have good memories and they wish to see everything and ask what it is and for what it is used. Later, when Columbus was justifying his wars and his enslavement of the Indians, they became cruel and stupid, a people warlike and numerous, whose customs and religions are very different from us.
It is always useful to think badly about people one has exploited or plans to exploit. Modifying one’s opinions to bring them into line with one’s actions or planned actions is the most common outcome of the process known as cognitive dissonance. No one likes to think of himself or herself as a bad person. We cannot erase what we have done, and to alter our future behavior may not be in our interest. To change our attitude is easier.

the truth about the 1st Thanksgiving

Humans evolved in tropical regions. People moved to cooler climates only with the aid of cultural inventions: clothing, shelter, and fire.
William McNeill reckons the population in 1492: Americans (100 M), Europe(70M). It is the plague that help European settlers dominate the population over the centuries.
In 1970, Wamsutta Frank James went to Plymouth and declared Thanksgiving day a National Day of Mourning for Native Americans.
The true history of Thanksgiving reveals embarrassing facts. The Pilgrims did not introduce the tradition; Eastern Indians had observed annual harvest celebration for centuries. Our modern celebrations date back only to 1863 during the civil war when the Union needed all the patriotism.
The antidote to feel-good history is not feel-bad history, but honest and inclusive history. If textbook authors feel compelled to give moral instruction, they could accomplish this aim by allowing student to learn both the good and the bad sides of the Pilgrim tale. The conflict would then become part of the story, and students might discover that the knowledge they gain has implications for their lives today.

Monday, October 23, 2017

organizational behavior


Organizational Behavior, 13th, 2009
Robins, professor of SD state university
(15th, 2012),(16th, 2014), (17th, 2016)
content structure:
  1. Introduction
  2. individual: diversity, attitudes and job satisfaction, emotions and moods, personality and values, perception and decision making, motivation concepts and application
  3. group: foundations, understanding, communications, leadership, power and politics, conflicts and negotiation, organization structure
  4. organization system: organizational culture, HR policies and practices, organizational change and stress management.

1 what’s organizational behavior

In today’s increasingly competitive and demanding workplace, managers can’t succeed on their technical skills alone. They also have to have good people skills. This book has been written to help both managers and potential managers develop those people skills.
Organizations exist to achieve goals, someone has to define those goals and the means for achieving the: management is that someone. there are 4 functions:
  1. planning: define an organization’s goals, establish an overall strategy for achieving those goals, develop a comprehensive set of plans to integrate and coordinate activities
  2. organizing: determine what tasks are to be done, who is to do them, how the tasks are to ge grouped, who reports to whom, and where decisions are to be made.
  3. leading: motivate employees, direct the activities of others, select the most effective communication channels, resolve conflicts among members.
  4. controlling: monitor the organization’s performance,compare with the previously set goals, get the organization back on track.
Management has 3 roles: interpersonal(including symbolic head,leader, liaison), informational, decisional
Management has 3 skills: technical, human, conceptual (identify problem, develop alternative solutions to correct these problems).
Management has 4 activities:
  • traditional management(decision making, planning, controlling),
  • communication (exchanging routing information),
  • human resource management(motivating, disciplining, managing conflict, staffing, and training)
  • networking (socializing, politicking, interact with outsiders)
Average manager spends equal time to every activity. Effective managers (performance-oriented) spend 44% on communication and 26% on human resource, but successful manager(promotion-oriented) spend 48% on networking and politics, 28% on communication, 13% on traditional management, 11% on human resource.
Whether or not you’ve explicitly thought about it before, you’ve been reading people almost all your life. You watch what others do and try to explain to yourself why they have engaged in their behavior and predict what they might do under different sets of conditions. You can improve your predictive ability by your intuition and a more systematic approach.
You have a lot fo preconceived notions that you accept as facts. While OB is based on a number of behavioral disciplines, such as psychology, social psychology, sociology, and anthropology.
James March, Professor of OB at Stanford
God gave all the easy problems to the physicists.
OB was developed by applying general concepts to a particular situation, person, or group. OB scholars would avoid stating that everyone likes complex and challenging work. why? because not everyone likes a challenging job. Some people prefer the routine over the varied or the simple over the complex. A job that is appealing to one person may not be to another.
melting-pot assumption: different people would somehow automatically want to assimilate. It is being replaced by one that recognizes anv values differences.

3 attitude and job satisfaction

attitudes have 3 components: cognition, affect, and behavior.
cognitive dissonance by Eeon Festinger: any incompatibility an individual might perceive between two or more attitudes or between behavior and attitudes. Any form of inconsistency is uncomfortable and that individuals will attempt to reduce the dissonance and the discomfort.:
  • change attitude
  • change behavior
  • develop a rationalization for the discrepancy
e.g. smoke. They can deny, brainwash themselves by articulating the benefit. Or they can quit their job because the dissonance is too great.
No one can completely avoid dissonance. The desire to reduce dissonance depends on:
  • the importance of the elements creating it: fundamental values, self-interest, identification with individual
  • how well he can control the element
  • the rewards of the dissonance
Dissonance are more likely to occur when social pressures to behave in certain ways hold exceptional power.
Altitude-Behavior relationship is likely to be much more stronger if an attitude refers to something with which the individual has direct personal experience. Asking college students with no significant work experience how they would respond to working for an authoritarian supervisor is far less likely to predict actual behavior than asking that same question of employees who have actually worked for such individual.
Job Involvement/psychological empowerment. Good leaders empower their employees by involving them in decisions, making them feel their work is important, and giving them discretion to do their own thing.

4 personality and values

Stephen Schwarzman , CEO of Blackstone, might be described as relatively narcissistic. He says his mission in life is to inflict pain and kill off his rivals. “I want war, not a series of skirmishes.”
Personality is the sum total of ways in which an individual reacts to and interacts with others. Managers use personality tests in the hiring process or managing process.
Self-report surveys work well but the person may fake good to create a good impression. And the mood also affect the accuracy. Observer-rating surveys are a better predictor of success on the job.
Research in personality development has tended to better support the importance of heredity over the environment.
Myers-Briggs Type Indicator(MBTI) is the most widely used personality-assessment instrument. 100 questions.
  • extravered/introverted (E/I)
  • sensing/intuitive(S/N)
  • thinking/feeling(T/F)
  • judging/perceiving(J/P)
I may be ISTP
In spite of its popularity, most of the evidence suggests MBTI is not a valid measure of personality. One problem is its dichotomy division. Anyway, MBTI can be a valuable tool for increasing self-awareness and providing career guidance. But the results tend to be unrelated to job performance.

big 5

  • conscientious: very careful about doing what you are supposed to do. responsible and dependable, an indicator of job performance
  • emotional stability: positive and optimistic in their thinking and experience fewer negative emotions.
  • extravert: experience more positive emotions and more freely express these feelings, perform better in jobs require significant interpersonal interaction. More socially dominate and a strong predictor of leadership. The downside is more impulsive than introverts. engage in risky behavior.
  • openness. more creative, more comfortable with ambiguity and change, cope better with organizational change and more adaptable in changing contexts.
  • agreeable: better liked, do better in interpersonally oriented jobs such as customer service. more compliant and rule abiding, do better in school. However, it is associated with lower level of carrer success, especially earnings. They may because they are poorer negotiators; they are so concerned with pleasing others that they often don’t negotiate as much for themselves as do others.

core self-evaluation

self-perfective: whether they like or dislike themselves, see themselves as capable and effective, in control of their environment. One study of Fortune 500 CEO showed that many are overconfident. But the point is, if we decide we can’t do something, we won’t try, and not doing it only reinforces our self-doubts.

Machiavellianism

Kuzi makes no apologies for the aggressive tactics he’s used to propel his career upward. “I’m prepared to do whatever I have to do to get ahead”.
pragmatic, maintains emotional distance, and believes that ends can justify means. “if it works, use it”.
manipulate more, win more, less persuaded, and persuade others more.
high Machs flourish in 3 situational factors:
  1. interact face-to-face with others rather than indirectly
  2. situation has a minimal number of rules and regulations
  3. low Machs are distracted by emotional involvement with details irrelevant to winning
Whether high Machs make good employees depend on the type of job. In jobs that require bargaining skills(labor negotiation), offer substantial rewards for winning(commissioned sales), high Machs will be productive.

Narcissism

  • likes to be the center of attention.
  • tend to talk down to those who threaten them, treating others as if they were inferior.
  • selfish and exploitive, carry the attitude that others exist for their benefit.

self-monitoring

  • individual’s ability to adjust behavior to external, situational factors.
  • show considerable adaptability in adjusting their behavior to external situational factors.
  • highly sensitive to external cues and can behave differently in different situations.
  • capable of presenting striking contradiction between public persona and private self.
  • receive better performance rating, more likely to emerge as leader, more mobile in their career.
low self-monitor is politically inept, unable to adjust her behavior to fit changing situations. tend to display their true disposition and attitudes in every situation.

risk-taking

donald trump

Type A personality

aggressive, always moving/eating rapidly, feel impatient with the rate of most event, can’t cope with leisure time. obsessed with numbers. operate under moderate to high level of stress.
Type A do better than type B in job interviews because they are more likely to be judged as having desirable traits such as high drive, competence, aggressiveness, and success motivation.

proactive personality

identify opportunities, show initiative, take action, and persevere until meaningful change occurs. They create positive change in their environment, regardless of or even in spite of constraints or obstacles.

values

although values and personality are related, they’re not the same. Values are often very specific and describe belief systems rather than behavioral tendencies.

8 emotions and moods

emotional labor:
  • felt emotion: individual’s actual emotions
  • displayed emotions: the organization requires workers to show and considers appropriate for a given job. They are not innate; they are learned.
  • surface acting: hiding one’s inner feelings and forgoing emotional expressions in response to display rules. deal with displayed emotion.
  • deep acting: trying to modify one’s true inner feelings based on display rules. deal with felt emotion.
Surface acting is more stressful to employees than deep acting because it entails feigning one’s true emotions.
salary: (cognitive + emotion) > (cognitive-emotion) > (-cognitive-emotion) > (cognitive + emotion)