自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(92)
  • 收藏
  • 关注

原创 Huawei Coding Interview

Coding interview: Find the shortest possible distinguisher between a list of strings

2022-06-01 23:09:43 211

原创 2021-10-28

Thingy API for raw data: https://github.com/specknet/pdiotapp/blob/142497c9ab9ebb4ef62e2edbaf667d52cdee2097/app/src/main/java/com/specknet/pdiotapp/utils/Utils.java public static float[] decodeThingyPacket(byte[] values) { float accel_x = (float)

2021-10-28 13:43:29 199

原创 TensorflowLite iOS Tensor Data Type Initialisation from [[Float]]

TensorflowLite Data(copyingBufferOf:) method expects a flat array of Floats. For a nested array you may need to flatten it into a simple array first.A Swift Array is a fixed-sized structure with (opaque) pointers to the actual element storage. The withUns

2021-10-28 13:43:11 175

原创 Xcode beta version select and change directory

xcrun: error: active developer path ("/Applications/Xcode-beta.app/Contents/Developer") does not existUse sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --instal

2021-10-25 18:42:43 210

原创 fit a complex function using 101 RBF basis functions with Linear Regression

import numpy as npimport matplotlib.pyplot as pltdef rbf_tut1_q3(xx, kk, hh): """Evaluate RBF kk with bandwidth hh on points xx (shape N,)""" center = ((kk - 51) * hh) / np.sqrt(2) phi = np.exp((-(xx - center) ** 2) / hh ** 2) return ph

2021-10-02 21:53:11 160

原创 Mac ssh fails with “Port 22: connection refused“

System Preferences -> Sharing -> Remote Loginsame local area networkr, forwarding port 22Mac OS X Firewall is allowing ssh remote logins: System Preferences -> Security -> Firewall.use the ssh -v, ssh -vv, and ssh -vvv option for more diagno

2021-09-30 19:15:36 216

原创 SaveReplay for StarCraft IIusing pymarl

python3 src/main.py --config=qmix --env-config=sc2 with env_args.map_name=2s3z checkpoint_path=/home/jerry/pymarl/results/models/qmix__2021-09-24_20-58-18/ runner=episode t_max=22350This will save a game-play of current checkpointsave_replayoption allows

2021-09-25 10:57:47 362

原创 WSL2 X410 glx OpenGL error

List itemX Error of failed request: GLXBadContextMajor opcode of failed request: 147 (GLX)Minor opcode of failed request: 6 (X_GLXIsDirect)Serial number of failed request: 24Current serial number in output stream: 23|| ORGot an X11ErrorHandli.

2021-09-23 13:07:00 614

原创 Quarupted robot running no-input homeokinesis

from __future__ import divisionimport time# Import the PCA9685 module.import Adafruit_PCA9685# Uncomment to enable debug output.#import logging#logging.basicConfig(level=logging.DEBUG)# Initialise the PCA9685 using the default address (0x40).p.

2021-08-23 03:08:11 203

原创 Linux CMD: Rename multiple files command

mv *.jpg cartoon_*.jpg

2021-08-10 02:11:43 123

原创 Start up problem linux

press esc in 1 seconds to skip startup.nsh any other key to continuetype:exit

2021-08-06 18:12:17 1068

原创 MATLAB add-on recompile C file on Mac

otool -L lbfgsC.mexmaci64

2021-07-25 13:19:45 150

原创 Inverse Reinforcement Learning深层理解

通过极大似然公式:找到reward使得trajectory能产生尽可能多的reward (logZ起到归一化,限制reward不能无限大的作用)。直观上看,L的梯度是在expert policy下梯度的期望与在当前reward下梯度期望的差。增加从expert trajectory中的reward,减小从当前policy中采样的trajectory中的当前reward成分。最大熵IRL意义是在尽可能随机条件下最大化特证,对expert数据无法支持的其他动作不做过多推断(避免进行未做动作假设)。推导过程

2021-07-24 19:15:32 1104

原创 Server ~/.bashrc Miniconda and alias setup

# set ls color themetest -r "~/.dir_colors" && eval $(dircolors -b ~/.dir_colors)# aliasalias ls="ls --color"alias rm="rm -i"alias afs="cd /afs/inf.ed.ac.uk/user/s16/s1636966"alias jerry="source jerry/miniconda3/bin/activate "# set envexp

2021-07-21 09:37:53 103

原创 Another Makefile compiler commands inside a project

Original repo doing wavelet transformation project:https://github.com/ircam-ismm/waveletg++ tests_filterbank.cpp tests_paul.cpp tests_morlet.cpp main_wavelets_tests.cpp -o test -std=c++11 -I ../dependencies/catch -I ../dependencies/armanpy -I ../src ../b

2021-07-15 15:20:57 82

原创 creating std::complex<double>

std::vector<double> a{ 1.0, 2.0, 3.0 };std::vector<double> b{ 4.0, 5.0, 6.0 };std::vector<std::complex<double>> cvec( a.size() );std::transform( a.begin(), a.end(), b.begin(), cvec.begin(), []( double da, double db ) { return

2021-07-13 05:34:33 315

原创 G++ compiler flag -W -D explain

-W 显示警告,但是只显示编译器认为会出现错误的警告。-Wall 显示all警告在编译时, -W和-Wall选项一起使用!-D means #define something as in C++ main code-D sometimes can be added with some other paths useful for the code (executable)("-g" compile flag for use with the debugger) Inserting the `g’

2021-07-13 05:24:58 275

原创 Windows Running Ubuntu18 with WSL2

Running GUI with windows naive PUTTY:open the xcfe4 connection and set up address 3390:sudo /etc/init.d/xrdp startIn Putty connect to terminal(xfce4):localhost:3390Some other things to notics:set in the ssh_config file enable X11port Forwarding to t

2021-07-10 19:03:18 205

原创 Read image to std::vector<std::vector<float>> and the inversion

Read image to std::vector<std::vector> and write to image from std::vector<std::vector#include <iostream>#include <fstream>#include <string>#include <vector>#include <sstream>#include <stdio.h>using na

2021-06-27 16:15:40 351

原创 CIFAR and MNIST dataset

MNIST dataset download link: http://yann.lecun.com/exdb/mnist/index.htmlCIFAR-10 dataset download: http://www.cs.toronto.edu/~kriz/cifar.htmlTree structure of the directory data/:./data/cifar-10-batches-bin/data_batch_1.bin./data/cifar-10-batches-bin/

2021-06-26 17:13:30 116

原创 modelling a robot with lpzrobots

In creation of a hexapod:// create body double twidth = conf.size * conf.width ;// 1/1.5; double theight = conf.size * conf.height; // 1/4; trunk = new Box(conf.size, twidth, theight); // trunk = new Capsule(twidth,conf.size); trunk-&g

2021-06-17 17:06:31 69

原创 Understanding Paper -- From Motor Control to Team Play in Simulated Humanoid Football 1

Reference:From Motor Control to Team Play in Simulated Humanoid FootballPopulation Based Training of Neural NetworksHuman-level performance in 3D multiplayer games with population-based reinforcement learningLecture on Modeling Pitch Control

2021-06-03 01:48:36 367

原创 Standford Swift UI Lec1

import SwiftUIstruct ContentView: View { var body: some View { ZStack { RoundedRectangle(cornerRadius: 25.0) .stroke(lineWidth: 3) Text("Hello, jerry!") }

2021-06-02 07:08:39 91

原创 Eigen Complex Matrix (std::vector<std::complex<double> > )

Eigen::MatrixXd A(2,2); Eigen::MatrixXcd B(2,2); A << -1, -2, -3, -4; B.real() << 1, 2, 3, 4; B.imag() << 5, 6, 7, 8; Eigen::MatrixXcd C(2, 2); // C = B + A; not working // In order to explicitly cast the double matrix ...

2021-06-01 14:25:08 636

原创 using pydrake to solve (dual) LP question

##for the exam in AGTA, using pydrake LP module to solve dual LP questionprog = MathematicalProgram()y = prog.NewContinuousVariables(2)prog.AddLinearCost(4*y[0])prog.AddLinearCost(8*y[1])prog.AddLinearConstraint( y[0] + y[1] >= 2 )prog.AddLi

2021-05-23 03:18:13 112

原创 Makefile C++ for MacOS

CC = clang++BIN = rnnOBJS = rnn.o main.oRM = rm -rvfCXXFLAGS += -std=c++14 -Wall -v -g -I /usr/local/include/eigen3 all: $(BIN)$(BIN): $(OBJS) $(CC) $(CXXFLAGS) $(OBJS) -o $(BIN)clean: $(RM) $(OBJS) $(BIN)

2021-05-21 09:53:35 190

原创 Pytorch c++ cmake file and train model

A Minimal CmakeFile.txt ( with libtorch C++ ): find_packagecmake_minimum_required(VERSION 3.14 FATAL_ERROR)project(linear-regression VERSION 1.0.0 LANGUAGES CXX)find_package(Torch REQUIRED)set(EXECUTABLE_NAME linear-regression)add_executable(${EX

2021-05-21 09:09:38 210

原创 Dynamically change the controller within operation

case 'w' : controller->increaseW(-1); std::cout << "new w_0: "<<controller->getParam("w_0") << std::endl; break; void increaseW( double size ){ w_0 += size; };also, notic

2021-05-14 21:45:30 57

原创 ros_connection to lpzrobots

roscore take too long to load in:check ROS_IP and ROS_hostnamemaybe not the same network IP as stated above in ~/.bashrc fileIn order to compile C++ with ros you have to add LIB (libraries in /opt/ros/kinetic/lib) and INC (include paths in /opt/ros/kine

2021-05-08 10:30:33 69

原创 ROS get keyboard input and set default directory

in order to store matrix at the current directory:ROS_HOME=`pwd` roslaunch ros-invertmotornstep sox.launchIn order to get keyboard input along with the ROS program:(I use for store and restore matrix):See the last solution in URL: https://answers.ros.o

2021-04-17 19:44:12 79

原创 Windows install PyTorch GPU with CUDA 10.1

PyTorch without CUDA:conda install pytorch torchvision cpuonly -c pytorchPyTorch with CUDA 10.1:conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

2021-01-26 06:40:26 152

原创 Scan network mac command

if configarp - a

2021-01-25 05:45:32 178

原创 DevLog 2 Deep Into the eigenvectors and eigenvalues for R Matrix

R matrix is the matrix from x_t to prediction x_t+1: R = A*C +S which has the dimension of (sensor_numbers, sensor_nukmbers)Statistics:In file:A: Layer2_time1109B: Layer2_time1110C:Layer3_time1107D:Layer3_time1106A = np.array([ [1.131289, 0.2404

2021-01-24 01:07:22 171

原创 Add Speed and RelativePosition Sensors for robot in Lpzrobot

robot->addSensor(std::make_shared<SpeedSensor>(1,SpeedSensor::Translational,SpeedSensor::XYZ), Attachment(-1));robot->addSensor(std::make_shared<RelativePositionSensor>(1,1,RelativePositionSensor::XY), Attachment(0));

2021-01-19 09:02:08 107 1

原创 Cut a video in Linux using ffmpeg

ffmpeg -i hexabot2.mkv -ss 00:00:39 -t 00:02:28 -async 1 cut.mp4

2021-01-19 08:58:41 138

原创 pip export requirements.txt or yml from conda

conda list -e > requirements.txtconda env export > <environment-name>.ymlCreate full conda environment from yml file:conda env create -f .yml

2021-01-18 22:10:27 251

原创 pip install different variant

pip install -r requirements.txt# install [train] version of python package with the rllib dependenciespip install -e .[train]# make sure you can run tests (and verify they are passing)pip install -e .[test]make test

2021-01-18 20:37:43 97

原创 Dockerfile and X11 XQuartz 2.7.8 on Mac

Use XQuartz version: XQuartz 2.7.8, else it may have libGL error!set XQuartz preferences --> Security --> Tick all connectionsin /etc/ssh/sshd_configset x11forwardingto yes (there are two x11forwarding, all set from no to yes)The scripts used to.

2021-01-05 01:29:10 302

原创 C# IEnumerator and IEnumerable<double> usage

//The way to assign Matrix:First transform double[*] to double[*,*] using this ArraytoMatrix method; Matrix qq = new Matrix(Utility.ArrayToMatrix(1, reals.Length, reals)); Console.WriteLine(qq); //The right way to use a

2021-01-04 07:38:22 202

原创 use C# to do matrix manipulation for unity

using System;using System.Collections;using System.Collections.Generic;using System.IO;using LinearAlgebra.MatrixAlgebra;using LinearAlgebra.VectorAlgebra;using LinearAlgebra.LinearEquations;namespace LinearAlgebra{ class Program {

2021-01-03 23:52:41 135 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除