In nvim, I use plugin fugitive
open two vertical buffer (one form target, another from feature)
1 | :Gvdiffsplit! |
stay on middle and use
1 | :diffget [buffername](local) |
OR
go to target/feature buffer and use
1 | :diffput [buffername](target/feature) |
save the local file and use
1 | :Git add . |
1 | git remote add origin git@github.com:... |
origin is the name of the repository
Check remote repository settings:
1 | git remote -v |
Before push to remote repository, make sure the branch name is the same.
find all the branch
1 | git branch -a |
find all the branch on remote repository
1 | git remote -r |
Rename
1 | git branch -m oldBranchName newBranchName |
Move to branch:
1 | git checkout [branchname/SHA-1] |
A Git submodule allows a user to include a Git repository as a subdirectory of another Git repository. This can be useful when a project needs to include and use another project. For example, it may be a third-party library or a library developed independently for use in multiple parent projects. With submodules, these libraries can be managed as independent projects while being used in the user’s project. This allows for better organization and management of the code.
To add an existing Git repository as a submodule to a project, the git submodule add command can be used. The command format is git submodule add <url> <path>, where <url> is the URL of the submodule repository and <path> is the storage path of the submodule in the project. For example, if a user wants to add the remote repository https://github.com/username/repo.git as a submodule to their project and store it in the my-submodule directory, they can use the following command:
1 | git submodule add https://github.com/username/repo.git my-submodule |
This will successfully add a submodule named my-submodule to the user’s project.
1 | git log |
1 | commit 0637340f4d8d288a8d24dd5193855c9e5def776d (HEAD -> main, origin/main, origin/HEAD) |
1 | git reset --hard [version hash] |
1 | git pull |
or locally
1 | git checkout master |
1 | git clone ... |
1 | git log |
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$.