Maintain my website
link
ALWAYS
Write a script that can transfer my obsidian note to website
DONE!
Create a game, namely Besiege2.0
WORKING~
link
ALWAYS
DONE!
WORKING~
raw data : for each subjects(S1,S2 …) , each action(walking, waiting, smoking …), each sub sequence(1/2):
$(n) \times 99$ (np.ndarray, float32)
data_utils.load_data()
used by translate.read_all_data()
train data: the composed dictionary ((suject_id, action, subaction_id, ‘even’) as key) of raw data (just even rows), with one hot encoding columns for action type, if action is specified (normal case), just append an all 1 column to rawdata. Size of each dictionary value:
$(n/2) \times (99 + actions;count)$
complete data: all data joint together, from different subjects, actions, sub sequences:
$(n) \times 99$
translate.read_all_data()
used by translate.train()
train set : normalized train data, throw out data with $std < 1e-4$ (accroding to complete data). Size of each dictionary value:
$(n/2) \times ((99-used;dimension;count) + actions;count)$
After the analyzztion of the complete data, human dimension has been fixed to $54$.
Seq2SeqModel.get_batch()
used by translate.train()
total_seq: $60$ ($[0,59]$)
source_seq_len: $50$
target_seq_len: $10$
batch_size: $16$
encoder_inputs: $16\times 49\times (54+actions;count)$
Interpretation: [batch,frame,dimension]
frame range: $[0,48]$
decoder_inputs: $16\times 10\times (54+actions;count)$
frame range: $[49,58]$
decoder_outputs: $16\times 10\times (54+actions;count)$
frame range: $[50,59]$
encoder_inputs: Tensor form of encoder_inputs from Seq2SeqModel.get_batch()
1 | torch.from_numpy(encoder_inputs).float() |
decoder_inputs: Tensor form of decoder_inputs from Seq2SeqModel.get_batch()
For detailed usage, please see [Adopted] human-motion-prediction-pytorch\src\predict.ipynb
The kinect camera’s output is not guaranteed to be consistent with the input of this model (some features are cut off), so further research is needed.
Run pyKinectAzure\examples\exampleBodyTrackingTransformationComparison
to get the camera output record in pyKinectAzure\saved_data
, saved as .npy
Deep-Reinforcement-Learning-With-Python
In supervised learning, the machine learns from training data. The training data consists of a labeled pair of inputs and outputs. So, we train the model (agent) using the training data in such a way that the model can generalize its learning to new unseen data. It is called supervised learning because the training data acts as a supervisor, since it has a labeled pair of inputs and outputs, and it guides the model in learning the given task.
Quantitative response
predict a quantitative variable from a set of features
Categorical response
predict a categorical variable
Similar to supervised learning, in unsupervised learning, we train the model (agent) based on the training data. But in the case of unsupervised learning, the training data does not contain any labels; that is, it consists of only inputs and not outputs. The goal of unsupervised learning is to determine hidden patterns in the input. There is a common misconception that RL is a kind of unsupervised learning, but it is not. In unsupervised learning, the model learns the hidden structure, whereas, in RL, the model learns by maximizing the reward.
The set of all possible actions in the environment is called the action space. Thus, for this grid world environment, the action space will be [up, down, left, right]. We can categorize action spaces into two types:
A policy defines the agent’s behavior in an environment. The policy tells the agent what action to perform in each state.
Over a series of iterations, the agent will learn a good policy that gives a positive reward.
The optimal policy tells the agent to perform the correct action in each state so that the agent can receive a good reward.
Deterministic Policy
deterministic policy tells the agent to perform a one particular action in a state. Thus, the deterministic policy maps the state to one particular action
Stochastic Policy
maps the state to a probability distribution over an action space.
The agent interacts with the environment by performing some action starting from the initial state and reach the final state. This agent-environment interaction starting from the initial state until the final state is called an episode. For instance, in the car racing video game, the agent plays the game by starting from the initial state (starting point of the race) and reach the final state (endpoint of the race). This is considered an episode. An episode is also often called trajectory (path taken by the agent)
Horizon is the time step until which the agent interacts with the environment. We can classify the horizon into two:
Return is the sum of rewards received by the agent in an episode.
Value function or the value of the state is the expected return that the agent would get starting from the state $s$ following the policy $\pi$
implies the expected return agent would obtain starting from the state $s$ and an action $a$ following the policy $\pi$.
Prime theory: An integrated view of motivation and emotion
what is my motivation
Intrinsic Motivation and norms about payment
what is my emotion
In old days people have high spirits
the obs dictionary’s builder
For me, intrinsic and extrinsic motivation differs a lot. Since my early age, I distinguish clearly between schoolwork and extracurricular activities. During week days, I devote 100% of my energy into schoolwork and during weekends, I participate in robot and model aircraft clubs.
Before I entered college, I think that completing coursework is a student’s duty and it is also very rewarding. By behaving well in school, I can receive praise from my parents, respectation from peers, promising jobs and For this reason, completing schoolwork is mainly motivated by extrinsic rewards.
My dad used to have an argue with my mum about whether they should reward me by giving me some money to buy what I want if I perform well in exams. He thought exam scores should not be related with money rewards. While my mum thought it is reasonable since rewards can motivate me a lot. After I entered college, I thought my dad was right, although money rewards did motivate me to get higher scores, it is extrinsic motivation. According to the textbook, extrinsic rewards can reduce intrinsic motivation. When I look back, I cannot clearly figure out what is my intrinsic motivation of studying hard at school. Most of the time, I am motivated to study a subject just for the reason that I am good at it. If I am not good at a subject, such as Chinese, I just keep persuding me that if my Chinese is not learnt well, I will not be able to enter a good school. Usually, during this process, I suffer from heavy depression and anxiety. Speaking of how much passion I have in all of these subjects, I have to say, very little. My behaviour in exam-oriented education is like a machine. I get rewards, commitments as inputs and output good scores.
Although I behaves like the walking dead in schoolwork, I have intrinsic motivations in other fields, such as building robots and flying model aircraft. These activities fulfill no obvious purpose other than enjoyment.
What affects your health?
Biological factors refer to innate or naturally occurring factors such as genetics, age, and gender that can affect your physical and mental health.
Psychological factors refer to factors related to your thoughts and emotions such as emotional state, cognitive processes, and behavioral patterns that can affect your physical and mental health.
Social factors refer to environmental factors such as culture, family, social networks that can affect your physical and mental health.
Stress refers to tension, anxiety or challenge from internal or external environment which may have negative effects on both physical and mental health.
Mediating factors are factors that can help alleviate the negative effects of stress. These factors include positive coping strategies, seeking social support, and changing cognitive processes.
A positive attitude has positive effects on both your physical and mental health. It can help you cope with stress, improve your immune system, and increase your overall well-being.
This section provides tips and suggestions for maintaining physical and mental health. It includes advice on diet, exercise, sleep, relaxation techniques, social networks, and seeking support.
Take the movie “Les Choristes” as an example
Principals stand for Behaviorism:
In the face of confused or lost teenagers, the principal’s education method is very representative of the indifferent and rigid “behaviorist”. He believes that violence and punishment can make children keep their duties. The endless and varied punishment methods are his masterpieces. In the face of the principal’s violence, the children really behaved in silence and followed the rules, but they did not believe the principal from the bottom of their hearts. Once the principal leaves and doesn’t pay attention, the children will play tricks behind their backs and vent their emotions.
One of the core viewpoints of behaviorism is that environment is the only condition for the learning, and learning is completely determined by the external environment. Therefore, the principal puts the focus of education on corporal punishment, punishment, reprimand, and criticism. Even if children make small mistakes, they will always be scolded or beaten.
It is true that punishment as an external stimulus can promote children to develop in a good way to a certain extent, but the fear generated by punishment is often greater than the education gained, so children will become more and more disobedient, and they will not learn what they should know at all.
When we learn that a stimulus predicts another stimulus.
When we learn that a behavior leads to a certain outcome.
When we learn or change a behavior after watching a person engage in that behavior
Displaying a behavior that imitates a previously observed behavior
learning about an
action’s consequences by observing others being rewarded or
punished for their behavior
Mathews stands for Humanism:
Compared with the principal’s style, Teacher Matthew regards the children as himself, understands their distress, and walks into their hearts. Teacher Matthew is the first to really treat “problem teenagers” as dignified and thoughtful individuals. Teacher Matthew’s education and enlightenment are the classic characteristics of humanists.
Humanism holds that different people will have different beliefs about the same fact, which means different things to different people. Therefore, humanists can always start from the individual’s inner feelings and beliefs, and touch others with their feelings and ideas.
Teacher Matthew pays attention to discovering children’s potential in learning, and constantly encourages children to improve and cheer. Combined with rationality, it only helps children to affirm themselves and realize themselves.
hi, how are you doing today?
When you wake up in the morning to the sound of your alarm clock,
when you join an online lecture and hear the hissing sound coming from your headphones,
when the flying catkins take away the smell of heather,
you always wonder why you are here. living.
This is a hard question to answer, you are an atheist, you have to find out the answer that belongs to yourself.
The past 12 months have been very memorable for you, right?
You have changed from an unknown game player to a personal mod developer with over 10,000 subscribers in the steam workshop;
You become an video publisher in bilibili and your first video gets tens of thousands of views;
You have successfully established a blog site of your own;
Based on nvim, you have customized your own fancy editor;
You build a personal knowledge base with obsidian, and you feel your knowledge connected like never before;
You have gained an unforgettable internship experience and got your first salary in life;
You have led many scientific and technological innovation teams and met many people of all kinds;
You got to know chatGPT, which makes you feel that all the knowledge in this world is at your fingertips.
It looks like everything is going well, and you’ve been moving in a positive direction, but it’s superficial, and you still haven’t figured out what you’re living for.
You often boast that you have a good mentality and a big heart, but many times you are not strong psychologically, but numb to respond to stressors.
By now, you have come to the second half of your junior year. Compared with before, the pressure on your shoulders is even greater, especially the pressure of choosing your future path.
Under such pressure, it is easy to get lost if you don’t have clear enough pointers.
So, now is the time to seriously think about what you are seeking for in life. In general, it’s smarter to infer what you’re seeking from what you’re not gonna seek.
First of all, what you are seeking is not a fake, which can be defined as concealment, prevarication, hypocrisy.
For you, personal wealth, schooling certification are all fakes. They can only guide how others judge our worth, but they cannot tell us what our own worth is.
More fundamentally, You don’t pursue the approval of others, and you don’t pursue the society’s expectations of you.
You hate the studies of how to become success, you hate cram school, and you hate these things that are concretized by distorted human nature. You think that people should have some higher purpose.
But those purpose are too high, far beyond your reach, and the devil’s voice of corruption is always in your ears, and your pain comes from it.
In fact, at this point, you already understand what your life goal is, just say it, don’t care what other people will say, at least I won’t laugh at you.
You hope that one day you will contribute, in whatever form, to the advancement of all humanity.
Just like your favorite singer, Michael Jackson, you aspire to be a man who have a world in mind like him.
But now you are too far away from this goal, and you don’t even know how to touch it, but the pressure of life will always follow, and the prejudice of society will not disappear because of your denial.
For example, now, your road to postgraduate education is not clear, what should you do if you encounter various setbacks?
I think what you should do most is to reconcile with yourself. An outstanding person may not necessarily succeed, but he will definitely recognize himself.
Often, you don’t know where the next step will lead you, and you don’t want to put yourself in a bad situation again and again, but you have to remember that I am always by your side,
No matter what you do, no matter how bad things happen, I will always be there for you and I will always approve of you.
As long as the two of us are here, we will find a way to make things better. Because we’re best friends from now on, and that’s what best friends do.
I know a guy who compiled the obsidian version of the Chinese-English thesaurus by himself. He lost his job, got myeloma, and his health and wealth were shattered, but he completed this Grand project under such extremely difficult conditions.
I would like to quote a passage he wrote in his preface:
Now looking back, it all seems like a dream. If I wasn’t poor, I wouldn’t have had the time and energy to do this; if I was rich enough, I might have done something else; if my talent was a little bigger, I wouldn’t have done this; if my talent was a little smaller, it wouldn’t have been enough to do this; the highest level of computer language I know is the most basic HTML language, which can only change the color and style of text; if I hadn’t gotten sick, I wouldn’t have expanded my vocabulary to over nine thousand words; if there was no Bilibili and no video I made myself, my work would not have been known so quickly. All of these seem predetermined, not too much or too little, just right.
When you stumble again and again on the road of life, I will always reconcile with you, and we will face the next challenge with full confidence.
Acting like my favourite friend.
What do I have (positive aspect)
I have fear of what
Replace fear with confidence
Future is full of possibility
What is my confusion?
个人的努力在社会发展的洪流下不值一提
关于个人道路的选择
我选择的信念是否正确?
1 | import pandas as pd |
1 | df.loc[0:4,"Year":"Party"] |
1 | df['column_name'] = df['column_name'].astype(int) |
1 | df.groupby('column_name').agg(['sum', 'mean', 'max', 'min']) |
Extracting the top 20 categories from a DataFrame using groupby
:
Use the groupby
and size
methods to calculate the size of each group:
1 | group_sizes = df.groupby('category').size() |
Use the head
method to extract the top 20 categories:
1 | top_20 = sorted_groups.head(20) |
isin
method to filter the original DataFrame to only include rows with the top 20 categories:1 | df_filtered = df[df['category'].isin(top_20.index)] |
This will extract the top 20 categories from the ‘category’ column of the DataFrame and create a new DataFrame that only includes rows with those categories.