Skip to content

Instantly share code, notes, and snippets.

View longxianlei's full-sized avatar
💭
Light-Weight Object Detection Neural Networks design target on FPGA

Xianlei Long longxianlei

💭
Light-Weight Object Detection Neural Networks design target on FPGA
View GitHub Profile
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(0)
def sig_fun(t):
return 1/(1+np.exp(-t))
@longxianlei
longxianlei / tsp_google.py
Created April 21, 2021 16:03
Using the Google Solver to solve the TSP problems.
#!/usr/bin/env python
"""Simple travelling salesman problem on a circuit board."""
import math
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
import time
def create_data_model():
@longxianlei
longxianlei / draft.py
Created April 2, 2021 08:37
TSP problem using different method to solve it in 2D space.
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial.distance import cdist
from py2opt.routefinder import RouteFinder
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
np.random.seed(0)
method_1 = 'euclidean'
method_2 = 'chebyshev'
@longxianlei
longxianlei / new_send_voltage_new_read_txt.py
Created February 28, 2021 07:47
create local directory by exepriment date and save/read data from it.
import zmq
import time
import random
import os
import numpy as np
import matplotlib.pyplot as plt
context = zmq.Context()
# Socket to talk to server
print("Connecting to hello world server…")
@longxianlei
longxianlei / detectron2-tutorial.ipynb
Last active April 2, 2021 08:38
Detectron2 Tutorial.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.