Measure Zero


  • About

  • Quotes

  • Notes

  • Sitemap

  • Search

YDK 转 PDF 开发小记

2023-03-25 | ~ | Games

地址: https://ydk2decklist.streamlit.app/

Read more »

苏州邀请赛 B 组战报

2023-03-18 | ~ | Games

线下赛, 3 月 12 日苏州邀请赛 B 组, RIF 20 分钟包干, 4 胜 1 平 2 负, 排名 9/43. 对手很弱, 但打得不好.

Read more »

俄罗斯连珠快棋赛战报

2023-02-19 | ~ | Games

今天想下棋, 打开 vint 一看, 刚好有比赛. 俄罗斯的比赛 (地址), 塔拉山口-10 规则, 5+2 快棋, 8 轮. 最终 4-4 ×〇××〇×〇〇, 排名 15/28.

很久没下棋了, 昨天熬夜, 今天开赛前还在补觉, 满脑子还是国际象棋.

Read more »

Minimum cut 的一个应用

2023-01-14 | ~ | Machine Learning

同事看表格检测的文章

  • Tensmeyer, C., Morariu, V. I., Price, B., Cohen, S., & Martinez, T. (2019, September). Deep splitting and merging for table structure decomposition. In 2019 International Conference on Document Analysis and Recognition (ICDAR) (pp. 114-121). IEEE.

中的 Split Model 的 Inference 那节. 文章采用的表格检测分为两步, 先划若干条竖直线和水平线将图像分割为许多单元格, 再合并单元格得到表格.

Read more »

MLFlow 简介

2023-01-06 | ~ | Machine Learning

管理深度学习实验

可以参考 这个问题 下的回答. 主要需要保存每次实验的

  • 代码 (Git 提交记录)
  • 数据 (路径), 模型
  • 超参数, 指标
  • 日志

保证实验结果好找, 便于复现实验. 这类工具 (满足上述部分功能) 有很多, 比如 TensorBoard; 自己写也可以.

介绍 MLflow

MLflow 是开源的机器学习工作流 (workflow) 管理平台, 提供了 Python, R, Java, REST API 等多种接口. 它是 Spark 团队 (他们还创建了 Databricks 公司) 2018 年的新作, 现在已经到 2.1 版本了.

With origins in academia and the open source community, Databricks was founded in 2013 by the original creators of Apache Spark™, Delta Lake and MLflow.

如果只是管理实验, 那每个人在本地上自己操作就行. MLflow 提供了中心化的管理, 有助于多人协作, 管理模型生命周期. 包含如下四个组件 (最主要的是 tracking 和 model registry).

Read more »

Huggingface Transformers Trainer as a general PyTorch trainer

2023-01-04 | ~ | Machine Learning

受 这篇 启发, 自定义 Huggingface Transformers Trainer 做通用训练器.

模型定义照常.

import torch.nn as nn

class Model(nn.Module):
    def forward(self, inputs):
        ...
        return logits

自定义损失函数. 损失函数要么写在模型的 forward 里 (Huggingface 的写法), 要么继承 Trainer 类, 覆写 compute_loss.

import transformers

class MyTrainer(transformers.Trainer):
    def compute_loss(self, model, inputs, return_outputs=False):
        labels = inputs.pop('labels')
        logits = model(**inputs)
        # loss_fct = nn.CrossEntropyLoss()
        loss_fct = nn.BCEWithLogitsLoss()
        loss = loss_fct(logits, labels)
        # TODO: tested only with `return_outputs=False`
        return (loss, {'logits': logits}) if return_outputs else loss
Read more »

Notes on Distributed Data

2023-01-01 | ~ | Tech
  • Kleppmann, M. (2017). Designing data-intensive applications: The big ideas behind reliable, scalable, and maintainable systems. “ O’Reilly Media, Inc.”.

There are various reasons why you might want to distribute a database across multiple machines:

  • Scalability
  • Fault tolerance/high availability
  • Latency

Replication

Replication means keeping a copy of the same data on multiple machines that are connected via a network. All of the difficulty in replication lies in handling changes to replicated data.

  • 使数据和用户地理邻近 (减少延迟)
  • 系统部分故障也能继续工作 (提高可用性)
  • 横向扩展处理读取请求 (提高读取吞吐量)

In this chapter we will assume that your dataset is so small that each machine can hold a copy of the entire dataset.

Read more »

GPT-1 到 ChatGPT 简介

2022-12-24 | ~ | Machine Learning

总体时间线参考 这里.

GPT-1~3

GPT-1

Our system works in two stages; first we train a transformer model on a very large amount of data in an unsupervised manner — using language modeling as a training signal — then we fine-tune this model on much smaller supervised datasets to help it solve specific tasks.

We trained a 12-layer decoder-only transformer with masked self-attention heads (768 dimensional states and 12 attention heads).

GPT 全称 generative pre-training, 就是预训练 + 微调. 时间顺序从前到后依次是, GPT-1, BERT, GPT-2.

来自 BERT 论文

Read more »

[Walkthrough] Install and set up Redis

2022-12-19 | ~ 2023-01-04 | Tech

Check system info.

cat /etc/os-release

Follow a walkthrough listed here. The below works on CentOS 7.

Read more »

Atypical: Season 4 Episode 1 Transcript

2022-12-18 | ~ | Language

一时兴起的听写, 不保证对. 听了个开头 (然后看完了), Sam 的台词最容易听.

Read more »
1 2 3 4 … 18
Shiina

Shiina

知乎 豆瓣 bangumi Instagram Weibo
Creative Commons
RSS
© 2019 - 2025   Shiina   CC BY-NC-ND 4.0
RSS  
Powered by Jekyll
 
Theme NexT.Mist