curl https://sh.rustup.rs -sSf | sh
curl -LsSf https://astral.sh/uv/install.sh | sh
# start a new project | |
uv init --lib --package dev --build-backend maturin --author-from "Rahul Bhadani" | |
cd dev | |
# install python | |
uv python install 3.12 | |
# create a virtual environment | |
uv venv --python 3.12 | |
# activate virtual environment | |
source .venv/bin/activate |
import os | |
from colorama import Fore, Style | |
WANTED_WIDTH = 100 | |
DISPLAY_WIDTH = min(WANTED_WIDTH, os.get_terminal_size().columns - 2) | |
print("┏" + "".center(DISPLAY_WIDTH, "━") + "┓") | |
print(f"┃{Fore.RED}" + "CMakeLists to C++17 Utils".center(DISPLAY_WIDTH, " ") + f"{Style.RESET_ALL}┃") | |
print(f"┃{Style.BRIGHT+ Fore.BLACK}" + "Meltwin - 2023".center(DISPLAY_WIDTH, " ") + f"{Style.RESET_ALL}┃") | |
print("┗" + "".center(DISPLAY_WIDTH, "━") + "┛") | |
print() |
I made a repository where you can create issues if you have any problem during manual installation of ROS1. It will hopefully help people to find their problem more quickly. If you have any problem with the steps below, please:
""" | |
RNN character generator | |
RNN implementation with Dense layers | |
There is an RNN layer in pytorch, but in this case we will be using | |
normal Dense layers to demonstrate the difference between | |
RNN and Normal feedforward networks. | |
This is a character level generator, which means it will create character by character |
""" | |
Three ways of computing the Hellinger distance between two discrete | |
probability distributions using NumPy and SciPy. | |
""" | |
import numpy as np | |
from scipy.linalg import norm | |
from scipy.spatial.distance import euclidean | |
import pygame | |
from pygame import gfxdraw | |
import numpy as np | |
class Window: | |
def __init__(self, sim=None, config={}): | |
# Simulation to draw | |
#self.sim = sim | |
# Set default configurations |
def minimize_fuel_consumption(num_timesteps, velocity, acceleration, fuel_consumption_function): | |
# Initialize the cost function with a large value for all states | |
cost = [[float('inf') for _ in range(len(velocity))] for _ in range(num_timesteps)] | |
# Define the set of actions | |
actions = ['accelerate', 'decelerate', 'maintain constant speed'] | |
# Initialize the cost for the initial state to zero | |
cost[0][0] = 0 |
import numpy as np | |
class MDP: | |
# Author: Rahul Bhadani | |
# Initial Date: Dec 10, 2022 | |
def __init__(self, velocity_min, velocity_max, acceleration_min, acceleration_max, velocity_step, acceleration_step, acceleration_min_accelerate, acceleration_max_accelerate): | |
# Define minimum and maximum values for velocity and acceleration | |
self.VELOCITY_MIN = velocity_min | |
self.VELOCITY_MAX = velocity_max | |
self.ACCELERATION_MIN = acceleration_min |