文章分类 -  Python

1 2 3 4 5 ··· 7 下一页
摘要:模型微调 模型微调(Model Fine - Tuning)是迁移学习中的一种常用技术,它基于预训练模型,在特定的数据集上进一步训练模型,以适应特定的任务。以下是模型微调的一般过程:参数:直接决定了模型的结构和功能,其取值决定了模型对数据的拟合程度和预测能力。是模型在训练过程中自动学习和调整的变量, 阅读全文
posted @ 2025-04-08 15:47 Adamanter 阅读(36) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- encoding: utf-8 -*- """ """ from loguru import logger l = [[1, 2, 3, 4, 12], [2, 4, 5, 6, 9, 78], [2, 3, 4, 5, 8, 12, 78]] 阅读全文
posted @ 2021-12-22 11:31 Adamanter 阅读(104) 评论(0) 推荐(0)
摘要:# 开始日期 import datetime # 生成date 和datetime 两种格式 begin = datetime.date(2021, 11, 22) end = datetime.datetime.now().date() print(type(begin), type(end), 阅读全文
posted @ 2021-12-17 11:04 Adamanter 阅读(719) 评论(0) 推荐(0)
摘要:前中后遍历的基本解释 顺序的遍历是按照根节点的先后访问顺序制定的。(根->左->右)前序遍历:首先访问根结点,然后遍历左子树,最后遍历右子树(左->根->右)中序遍历:首先遍历左子树,然后访问根节点,最后遍历右子树(左->右->根)后序遍历:首先遍历左子树,然后遍历右子树,最后访问根节点 链表代码解 阅读全文
posted @ 2021-06-15 14:38 Adamanter 阅读(305) 评论(0) 推荐(0)
摘要:from collections import defaultdict x = defaultdict(dict) x['1']['2'] = 10 print(x) 阅读全文
posted @ 2021-05-25 16:20 Adamanter 阅读(18) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- encoding: utf-8 -*- from concurrent.futures import ThreadPoolExecutor as ConThreadPoolExecutor, as_completed from loguru i 阅读全文
posted @ 2021-05-25 13:19 Adamanter 阅读(41) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- encoding: utf-8 -*- def strQ2B(ustring): """把字符串全角转半角""" ss = [] for s in ustring: rstring = "" for uchar in s: inside_cod 阅读全文
posted @ 2020-12-11 16:42 Adamanter 阅读(892) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- encoding: utf-8 -*- import time from functools import wraps def time_statistics(func): @wraps(func) def inner_func(*args, 阅读全文
posted @ 2020-12-11 16:37 Adamanter 阅读(207) 评论(0) 推荐(0)
摘要:1. vthread 这个模块非常简洁方便, 只需要2句话 import vthread@vthread.pool(10, join=True) 2. 案例 #!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Author: Victor @Co 阅读全文
posted @ 2020-10-14 18:47 Adamanter 阅读(596) 评论(0) 推荐(0)
摘要:1、安装: 终端输入:pip install locust 安装,安装后locust --version查看当前Locust版本 终端输入: locust --help 显示帮助信息 locust官网: https://www.locust.io/ 官网帮助文档: https://docs.locu 阅读全文
posted @ 2020-10-13 14:08 Adamanter 阅读(533) 评论(0) 推荐(0)
摘要:1. decimal from decimal import Decimal # 设置小数位数 m = Decimal('0.000') print(m, type(m)) # 0.000 <class 'decimal.Decimal'> # 将浮点数转换为decimal类型 x = Decima 阅读全文
posted @ 2020-10-10 11:21 Adamanter 阅读(252) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Author: Victor @Contact: @163.com @Date: 2020/9/29 @function: '' ''' import time import datetime 阅读全文
posted @ 2020-09-29 19:35 Adamanter 阅读(78) 评论(0) 推荐(0)
摘要:基本案例 #!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Author: Victor @Contact: @163.com @Date: 2020/9/29 @function: '' ''' import threading from a 阅读全文
posted @ 2020-09-29 19:24 Adamanter 阅读(252) 评论(0) 推荐(0)
摘要:最简单的例子 import timefrom threading import Threadfrom apscheduler import eventsfrom apscheduler.events import JobEventfrom loguru import loggerfrom apsch 阅读全文
posted @ 2020-09-29 19:05 Adamanter 阅读(272) 评论(0) 推荐(0)
摘要:模块功能 能够同时统计代码量和代码复杂度 支持语言 默认递归分析文件夹支持下列的一些语言等C/C++ (works with C++14)JavaC# (C Sharp)JavaScriptObjective CSwiftPythonRubyTTCN-3PHPScalaGDScript 安装 Git 阅读全文
posted @ 2020-09-23 11:12 Adamanter 阅读(5613) 评论(0) 推荐(0)
摘要:xpinyin 模块 from xpinyin import Pinyin # 实例拼音转换对象 p = Pinyin() # 进行拼音转换 ret0 = p.get_pinyin("乐歌股份") ret1 = p.get_pinyin("上证指数") ret2 = p.get_pinyin("上证 阅读全文
posted @ 2020-09-22 14:13 Adamanter 阅读(579) 评论(0) 推荐(0)
摘要:利用python实现汉字的简体和繁体相互转早有人做过,并发布到github上了,地址:https://github.com/skydark/nstools/tree/master/zhtools 该项目还有其他很多跟汉字相关的功能,本文只介绍繁体和简体相互转换 具体方法很简单,下载该项目中的 zh_ 阅读全文
posted @ 2020-09-18 11:22 Adamanter 阅读(960) 评论(0) 推荐(0)
摘要:mysql分页 1. limit m,n分页语句 SQL抽象语句: select * from dept order by deptno desc limit m,n;SQL-limit分页应用:select * from student limit (curPage-1) * pageSize, 阅读全文
posted @ 2020-09-18 11:04 Adamanter 阅读(376) 评论(0) 推荐(0)
摘要:单个字段和多个字段排序 code_dict = { 'sh001': {'code': 'shoo1', 'InstitutionNums': 598, 'Pinyin': 'jinrongjie'}, 'sh002': {'code': 'shoo2', 'InstitutionNums': 12 阅读全文
posted @ 2020-09-17 18:39 Adamanter 阅读(191) 评论(0) 推荐(0)
摘要:1.eventlet是什么 1.eventlet - 具有WSGI支持的异步框架 2.eventlet是python库函数,一个是处理和网络相关的,另一个可以通过协程实现并发 3.可以实现'并发'(绿色线程),非阻塞 4.对Python库函数改写,支持协程 绿色线程和普通线程区别1. 绿色线程几乎没 阅读全文
posted @ 2020-09-15 09:57 Adamanter 阅读(278) 评论(0) 推荐(0)

1 2 3 4 5 ··· 7 下一页