#!/bin/bash# Check for minimum number of required argumentsif[$#-lt4];thenecho"Usage: $0 docker_image head_node_address --head|--worker path_to_hf_home [additional_args...]"exit1fi# Assign the first three arguments and shift them awayDOCKER_IMAGE="$1"HEAD_NODE_ADDRESS="$2"NODE_TYPE="$3"# Should be --head or --workerPATH_TO_HF_HOME="$4"shift4# Additional arguments are passed directly to the Docker commandADDITIONAL_ARGS=("$@")# Validate node typeif["${NODE_TYPE}"!="--head"]&&["${NODE_TYPE}"!="--worker"];thenecho"Error: Node type must be --head or --worker"exit1fi# Define a function to cleanup on EXIT signalcleanup(){docker stop nodedockerrmnode}trap cleanup EXIT# Command setup for head or worker nodeRAY_START_CMD="ray start --block"if["${NODE_TYPE}"=="--head"];thenRAY_START_CMD+=" --head --port=6379"elseRAY_START_CMD+=" --address=${HEAD_NODE_ADDRESS}:6379"fi# Run the docker command with the user specified parameters and additional argumentsdocker run \--entrypoint /bin/bash \--networkhost\--namenode\--shm-size 10.24g \--gpus all \-v"${PATH_TO_HF_HOME}:/root/.cache/huggingface"\"${ADDITIONAL_ARGS[@]}"\"${DOCKER_IMAGE}"-c"${RAY_START_CMD}"
常用的线性回归模型主要有以下这些
简单线性回归多元线性回归多项式回归岭回归套索回归弹性网络回归逐步回归 一.简单的一元线性回归
1.导入必备的库
#导入必备的库
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection …
循环嵌套
循环嵌套的使⽤
while , do while , for ,这三种循环往往会嵌套在⼀起才能更好的解决问题,就是我们所说的:循环嵌套。这三种循环都可以任意嵌套使⽤ ⽐如: 写⼀个代码,打印⼀个乘法⼝…