Skip to content

Latest commit

 

History

History
690 lines (404 loc) · 16.3 KB

89的笔记.md

File metadata and controls

690 lines (404 loc) · 16.3 KB

ModuleNotFoundError

import sys
import os
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)

git和自定义安包 python setup.py install

挂载Windows磁盘

mount -t cifs //172.27.10.11/TrueMount test -o username=wyt,password='1234asd',vers=3.0

IP地址,用户名和密码都是Windows下面的, mmtt是Windows下的共享文件,wytszhuzhu权限为读写,

test是linux新建的挂载文件

wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh

apt-get install openjdk-8-jre openjdk-8-jdk
-f https://download.pytorch.org/whl/torch_stable.html
--index-url https://pypi.douban.com/simple
pip install --upgrade pip

CUDA_VISIBLE_DEVICES=1

ssh [email protected] -p2339    2339    1360471ce4cfe548           2337 admin2 af78f7682605759b

C:\Users\hugging\AppData\Local\JetBrains\PyCharm2022.1\remote_sources

ll /proc/pid  history (!n)
竖向选中 alt+鼠标左键
ls -lh 文件名称   查看单个文件大小
linux查看某个文件夹的大小 

清空wsl内存缓存 sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'

[linux查看某个文件夹的大

幼苗分类,病虫害检测,表型分割

    model = model.cuda()
    x = torch.randn(500, 1, 3, 224, 224)
    total = 0
    for i, input in tqdm(enumerate(x)):
        input = input.cuda()
        t1 = time()
        _ = model(input)
        total += time() - t1

    print("total={}".format(total))
A4B469963BF863CC
/TensorRT-8.6.0.12/lib

export LD_LIBRARY_PATH=/TensorRT-8.6.0.12/lib:$LD_LIBRARY_PATH

/TensorRT-8.6.0.12/bin

0 1,39,20,20
1 1,39,40,40
2 1,39,80,80

1,4,512,512 -> 4,512,512

docker start -ai trt_test

1,42,21,21
1,42,42,42
1,42,84,84
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <tlpi_hdr.h>
#include <sys/socket.h>
#include <sys/epoll.h>
#include <sys/signal.h>
#ifndef BUF_SIZE
#define BUF_SIZE 1024
#endif

int main (int argc, char* argv[]) {
    int inputFd, outputFd, openFlags;
    mode_t filePerms;
    ssize_t numRead;
    char buf[BUF_SIZE];

    if (argc != 3 || strcmp(argv[1], "--help") == 0)
        usageErr("old new file\n", argv[0]);
    openFlags = O_CREAT | O_WRONLY | O_TRUNC;
    inputFd = open(argv[0], openFlags, filePerms);
}

Ubuntu Trick

隐藏shell用户名

bash

​ fish: 输出 fish_config , 在prompt当中选择

网络命令

lsof(List Open File 的缩写)

方便杀死tcp的close wait

编译

readelf查看elf格式的文件信息

strace跟踪系统调用

git

1 初始化问题

fatal: bad revision 'HEAD'

mkdir test
cd test
git init
git commit -m 'Initial Commit' --allow-empty
git log
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

git remote add origin https://[token]@github.com/wytszhuzhu/sdfds.git
git branch -M master
git push -u origin master

克隆自己分支
git clone 。。。。
删除远程属性  git remove 查看远程属性
git remote remove origin 
用自己的更新远程仓库
git remote add origin https://[token]@github.com/wytszhuzhu/sdfds.git
git branch -M master
git push -u origin master

2 建立远程仓库

ssh

cpp features

1 if/switch初始化

// if (初始化语句; 条件) 语句 else 语句
// 相当于:
{
    初始化语句;
    if (条件) 语句 else 语句
}
// switch (初始化语句; 条件) 语句
// 相当于:
{
    初始化语句;
    switch (条件) 语句
}
ifswitch 语句中的初始化语句是一个变量声明,那么所声明的变量的作用域仅限于该语句以及其附属语句的范围。

#include <iostream>
#include <set>
using namespace std;
 
int main()
{
    set<string> myset;
    if (auto [iter, success] = myset.insert("Hello"); success) 
       cout << *iter << endl; // Hello
}

2 结构化绑定

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
std::tuple<int,string, double> nextToken(){
    return {4,"fallthrough", 4.5};
}

/*before
int main() {
    auto token = nextToken();
    std::cout<<std::get<int>(token)<<","<<std::get<std::string>(token) << endl; // 可以按照type返回,也可以index返回
    std::cout<<std::get<0>(token)<<","<<std::get<1>(token);
    return 0;
}
after*/
int main() {
    auto[tokenType,lexeme, money] = nextToken();
    std::cout<<tokenType<<","<<lexeme<<","<<money;
    return 0;
}

3 string_view

使用

引申和实现

4 内联变量

初始化特性

5 聚合初始化

struct A { int x; int y; int z; }; 
A b{.x = 1, .z = 2};

6 stringstream

用法

stringstream提取单词

两句话中常见的单词

class Solution {
public:
    vector<string> uncommonFromSentences(string s1, string s2) {
        unordered_map<string, int> fre;
        auto func = [&] (const string& s) {
            stringstream ss(s);
            string word;
            while (ss >> word)
                ++fre[word];
        };
        func(s1);
        func(s2);
        vector<string> res;
        for (auto [key, value] : fre) {
            if (value == 1)
                res.push_back(key);
        }
        return res;
    }
};

LC trick

位运算

x & (x - 1)

(64条消息) x&(x-1)的妙用_楚楚可薇的博客-CSDN博客

判断奇偶数

if ((len & 1) == 0) # 偶数最后一位是0
	return (left + right) / 2.0;
else                # 奇数最后一位是1
	return right;

common algorithm

lower_bound & upper_bound

数学

最大公约数

#include <numeric>
gcd()
Computes the greatest common divisor of the integers m and n.
If both m and n are zero, returns zero. Otherwise, returns the greatest common divisor of |m| and |n|.

int gcd(int a, int b) {
	int c = 0;
	if (a < b) swap(a, b);

	while (true) {
		c = a % b;
		if (c == 0) return b;
		else
		{
			a = b;
			b = c;
		}
	}

}

int gcd(int a, int b) {
    return !b ? a : gcd(b, a % b);
}

string

find

质数

素数筛选法

class Solution {
public:
    int countPrimes(int n) {
        int count = 0;
        vector<int> res(n);
        for (int i = 2; i < n; i++) {
            res[i] = 1;
        }
        for (int i = 2; i < n; i++) {
            if (res[i]) {
                count++;
                for (int j = 2 * i; j < n; j += i) {
                    res[j] = 0;
                }
            }
        }
        return count;
    }
};

docker问题

修改共享内存

获取线程真实ID

#include <sys/syscall.h>
syscall(SYS_gettid)

线程函数不返回出现 fish: Job 1, './a.out' terminated by signal SIGILL (Illegal instruction)

#include <bits/stdc++.h>
#include <boost/type_index.hpp>
#include <cstdio>
#include <pthread.h>
#include <sys/syscall.h>
#include <unistd.h>

using namespace std;

void *hello(void *s){
    printf("%s()\t, line = %d\t, getpid() = %#x\n",__FUNCTION__,__LINE__,getpid());
    printf("%s()\t, line = %d\t, pthread_self() = %#lx\t, SYS_gettid = %#lx\n",__FUNCTION__,__LINE__,pthread_self(),syscall(SYS_gettid));
  //  return NULL;
}


int main() {
    printf("%s()\t, line=%d\t, getpid()=%#x\n", __FUNCTION__ ,__LINE__, getpid());
    printf("%s()\t, line = %d\t, pthread_self() = %#lx\t, SYS_gettid = %#lx\n",__FUNCTION__,__LINE__,pthread_self(),syscall(SYS_gettid));

    pthread_t thread_id;
    pthread_create(&thread_id, NULL, hello, NULL);
    pthread_join(thread_id, NULL);
   // sleep(1);
    return 0;
}

dynamic_cast

[dynamic_cast用法总结_weixin_44212574的博客-CSDN博客

enable_shared_from_this

晦涩

private继承,子类不能转换成父类

chrono

move和forward

设计模式实现

智能指针实现

unique_ptr

shared_ptr

weak_ptr

容器实现

vector

string

list

deque

queue

array

threadPool

郭老师
71B600DA

计算机-郭伟立-71B600DA


杨老师
AE4632CA

计算机-杨杨-AE4632CA

计算机科学与工程学院-郭伟立-基

2020 - 2023 使用论文的哪些信息(pdf,作者,标题,单位,摘要等等),代码
七月十号

 

Galactica Galactica

附录有dataset介绍

它可以通过自动生成二次内容来综合知识:例如文献综述、百科文章、讲义等。最后,它可以组织不同的模式:将论文与代码联系起来,将蛋白质序列与化合物联系起来,将理论与LaTeX联 系起来

4800万篇论文、教科书和讲义、数百万种化合物和蛋白质、科学网站、百科全书等

image-20230703155810679

image-20230703155841161

LLaMA

6、ArXiv,占比2.5%
科研文献对于提升专业性也有重要作用,该工作对arXiv的Latex文件进行处理,将科学数据添加到预训练数据集中。
按照Lewkowycz等人(2022年)的做法,该工作删除了第一节之前的所有内容以及书目。
此外,还删除了.tex文件中的评论,以及用户写的内联扩展定义和宏,以增加论文之间的一致性。

7、Stack Exchange,占比2%

QA数据对于提升垂直的专业问题也有帮助。
该工作还使用了Stack Exchange的开放数据,Stack Exchange是一个高质量的问题和答案的网站,涵盖了从计算机科学到化学的不同领域。具体的,该工作保留了28个最大的网站的数据,从文本中去除HTML标签,并按分数(从高到低)对答案进行排序。

LLaMA: Open and Efficient Foundation Language Models
SCIBERT 是一个使用生物医学(82%)以及计算机科学(12%)方向总共114万篇科技论文预训练出来的BERT,可能更加适用于科技论文方向的自然语言处理任务。使用方法如下:

MT-NLG


image-20230703161713408

GPT-NeoX-20B

image-20230703162636674

Pubmed Abstracts and
PubMed Central, arXiv, FreeLaw, 5 USPTO
Backgrounds, 6 PhilPapers, 7 NIH Exporter

Finbert


BLURB

BioGPT:

https://zhuanlan.zhihu.com/p/606542929

MultiMedQA

https://zhuanlan.zhihu.com/p/599434778

PubMed GPT

PubMed Abstracts和PubMed Central

Linkbert

维基百科的超链接和学术文章的引用连接,提供文档作者认为有用的概念的背景知识

PubMedBERT

PubMed包含超过3000万篇摘要,PubMed Central(PMC)包含数百万篇全文文章。 

【学习笔记】PubMedBERT - 应用在生物医学领域中的NLP预训练语言模型 - 知乎 (zhihu.com)

BioMedLM,

stanford crfm基于GPT-2模型架构,使用PubMed生物医学论文的摘要和正文数据继续预训练,预训练数据有300B Tokens,在MedQA任务上达到了50.3的分数。

PMC-LLaMA

在LLaMA模型的基础上,加入4.9M PubmedCentral医学知识相关的学术论文数据,超过75B tokens,对LLaMA继续进行预训练。对比于BioMedLM,二者均是在PubMed上进行预训练,不同在于该项目基于LLaMA模型,同时在医学相关论文筛选有自己的一套逻辑。

论文题目:PMC-LLaMA: Further Finetuning LLaMA on Medical Papers
论文地址:https://arxiv.org/abs/2304.14454
项目地址:https://github.com/chaoyi-wu/PMC-LLaMA

BioMedGPT

我们首先收集放射学相关的科学论文作为预训练语料库,并在其上预训练 ChestXRayBERT。 然后,提出了一种抽象摘要模型,该模型由预训练的 ChestXRayBERT 和 Transformer 解码器组成。 最后,根据胸部 X 光报告对模型进行微调,以完成抽象总结任务

https://ieeexplore.ieee.org/abstract/document/9638337

Bloom