无标题
类和动态分配(一)设计一个String类 对类成员使用动态内存分配会产生一系列问题。我们需要对原有类体系进行扩充。 1. 实例:StringBad类 #include<iostream>#ifndef STRNGBAD_H_#define STRNGBAD_H_class StringBad{private: char * str; //指向字符串的指针 int len; //字符串的长度 static int num_strings; //对象个数public: StringBad(const char * s); //构造函数 StringBad(); //默认构造函数 ~StringBad(); //析构函数 //友元函数 friend std::ostream & operator<<(std::ostream & os,const StringBad &...
无标题
类和动态内存分配(二) 1. 在类中使用动态内存分配的注意事项 1.1 构造函数中使用new 如果在构造函数中使用new来初始化指针成员,则应在析构函数中使用delete new和delete必须相互兼容,new相对delete;new[]相对delete[] 因为只有一个析构函数,所有的构造函数都必须与它兼容 注意的是:delete或者delete[]都可以对空指针操作. NULl和0和nullptr:空指针可以用0或者NULL来表示,C++11使用一个特殊的关键词:nullptr来表示空指针. 应该定义一个复制构造函数,通过深度复制将一个对象初始化成另一个对象. String::String(const String &st)//复制构造函数{ len=st.len; str=new char[len+1]; std::strcpy(str,st.str); num_strings++;} 应该定义一个赋值运算符。 String& String::operator=(const...
本地部署大模型
安装ollama ollama是一种本地大模型管理工具 brew install ollama --cask 常见的 ollama 指令有: ollama list:显示模型列表。ollama show [model]:显示模型的信息ollama pull [model]:拉取模型ollama push [model]:推送模型ollama cp [model]:拷贝一个模型ollama rm [model]:删除一个模型ollama run [model]:运行一个模型ollama serve:启动本地 LLM 服务器 当使用ollama serve指令后,显示如下信息: 2025/03/26 13:23:33 routes.go:1230: INFO server config env="map[HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:2048 OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0...
kaggle Detect hallucinations in LLMs
赛题链接:https://www.kaggle.com/competitions/ml-olympiad-detect-hallucinations-in-llms 任务分析:这是一个文本分类任务,难点在于如何提取文本特征、建立文本关系特征,以及如何解决类别不平衡问题 运行环境、使用框架、语言 操作系统:Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux 硬件环境: Intel® Xeon® Gold 6226R CPU @ 2.90GHz + NVIDIA GeForce RTX 3090 * 8 (CUDA Version: 12.4) 语言和运行环境:python 3.9.21 (main, Dec 11 2024, 16:24:11) + jupyter notebook 7.2.2 使用框架:pytorch...
DataFountain-虚假职位招聘预测
赛题链接:https://www.datafountain.cn/competitions/448 任务分析:这是一个分类任务,难点在于,第一,数据集难以处理,第二,类别不平衡,负类样本占比达到95% 运行环境、使用框架、语言 操作系统:Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux 硬件环境: Intel® Xeon® Gold 6226R CPU @ 2.90GHz + NVIDIA GeForce RTX 3090 * 1 (CUDA Version: 12.4) 语言和运行环境:python 3.9.21 (main, Dec 11 2024, 16:24:11) + jupyter notebook 7.2.2 使用框架:pytorch 2.5.1+cu124 数据分析、特征设计、抽取、处理 数据处理部分的代码在data_processing.ipynb中,处理好的数据存储在...
[CVPR2024] Is Ego Status All You Need for Open-Loop End-to-End Autonomous Driving?
conclusion The planning performance of existing open-loop autonomous driving models based on nuScenes is highly affected by ego status (velocity, acceleration, yaw angle). With ego status involved, the model’s final predicted trajectories are basically dominated by it, resulting in a diminished use of sensory information. Methods utilizing ego status are not directly comparable and conclusions should not be drawn from such comparisons 目前存在的开环(端到端)自动驾驶模型的测试performance(数据集为...
苹果重装指定系统
macOS降级 下载需要安装的macos 首先需要下载需要的系统,地址:https://support.apple.com/zh-cn/102662. 下载完成后,会得到一个应用程序包,这个应用程序包中不仅放着操作系统,还有一些引导工具,有一个工具叫createinstallmedia,这是一个命令行工具,用于将 macOS 安装程序创建为可启动的安装介质. 简单来说,createinstallmedia可以把一个u盘变成重装系统u盘. 这个工具放在:...
[2024.11.25-arxiv] DiffusionDrive: Truncated Diffusion Model for End-to-End Autonomous Driving
motivation:diffusion model for planning diffusion model 现在很多应用在traffic simulation 上,在用 diffusion model 做 plan的没有。 (a): this paradigm does not account for the inherent uncertainty and multi-mode nature of driving behaviors. 无法表示 uncertainty (b): this large fixed-vocabulary paradigm is fundamentally constrained by the number and quality of anchor trajectories, often failing in out-of-vocabulary scenarios. Furthermore, managing a large number of anchors presents significant computational...
[ECCV 2024]GenAD: Generative End-to-End Autonomous Driving
motivation Most existing end-to-end autonomous driving models are composed of several modules and follow a pipeline of perception, motion prediction, and planning .However, the serial design of prediction and planning of existing pipelines ignores the possible future interactions between the ego car and the other traffic participants. Also, future trajectories are highly structured and share a common prior (e.g., most trajectories are continuous and straight lines). Still, most existing...
多跳转机本地端口转发--实现本地访问远程端口
本地端口转发 本地主机A想要访问服务器B上localhost:10086的服务,应该怎么做?一种常见做法就是,将A主机上的一个端口映射到主机B端口10086。 A无法直接访问B的IP地址,但是可以通过跳转机J1,J2来和B建立ssh关系,即:A–>J1—>J2—>B host ip username port A / / 10001,10002,10003 J1 1.1.1.1 user1 22(22端口建立ssh关系) J2 2.2.2.2 user2 22 B 3.3.3.3 user3 22 A登陆到跳转机J1,然后将A的端口10001 映射到 跳转机J2的22端口 (2.2.2.2:22) sshpass -p 'pw1' ssh -f -L 1:2.2.2.2:22 -N -o StrictHostKeyChecking=no user1@1.1.1.1 A登陆到跳转机J2(ssh连接localhost:10001),然后将A的端口10002 映射到 B的22端口...