Python 小白快速从入门到放弃:在结束后

这个系列的课程的目标在《在开始前》已经说得很清楚了:解决重复劳动或自己做好玩儿的小项目;尝试新的思维方式。这短短的几节课要想把 Python 的相关知识面面俱到是不可能的,但我觉得已经给出了一个全图景,大家只要围绕这个做,达到目标应该是不成问题的。我想说的还是一直提倡的:Just do it,在实践中不断成长。

More

Python 小白快速从入门到放弃:使用模块

上节介绍了函数,简单理解就是实现特定功能的一组代码,方便复用。本节介绍的模块其实就是把函数组合起来作为模块,让更加便利地完成任务。使用模块我们可以非常迅速地实现很多任务,而不用自己动手实现。Python 中的模块分为内置的(Python 安装后就有的)和社区模块(需要通过 pip install xxx 安装的)。

More

CTRL 论文 + 实践 + 源码

paper: ctrl.pdf

code: salesforce/ctrl: Conditional Transformer Language Model for Controllable Generation

核心思想:借鉴多任务,将文本标签作为输入的一部分(放在开头)控制文本生成。

Abstract

文本生成最大的问题是难以对其进行控制,本文发布了一个 1.6 billion 参数的条件 transformer language model,训练能够 govern 风格、内容、特定任务行为等的控制代码。控制代码来自与原始文本共现的结构,保留了无监督学习的优点,同时提供对文本生成更明确的控制。这些控制代码还允许 CTRL 预测训练数据的哪些部分最有可能给出序列。

More

GraphQL Elixir Glance

There are several problems with the origin docs, so I reproduced this quick glance. It’s much simple and only contains the brief information. Hope this is helpful to u.

Getting Started

Schema-Driven Development

  • Define your types and the appropriate queries and mutations for them.
  • Implement functions called resolvers to handle these types and their fields.
  • As new requirements arrive, go back to step 1 to update the schema, and continue through the other steps.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Step1: create
$ mix phx.new community --no-html

# Step2: add dependencies to `mix.exs`
{:dataloader, "~> 1.0.0"}, # absinthe_ecto was DEPRECATED
{:absinthe_plug, "~> 1.4.0"}

# Step3: modify database info in `config/dev.exs`
# maybe you should modify username or password

# Step4: install deps
$ mix deps.get

# Step5: generate tables and seed data
$ mix phx.gen.context News Link links url:string description:text

# Step6: add seed data in `priv/repo/seeds.exs`
alias Community.News.Link
alias Community.Repo
%Link{url: "http://graphql.org/", description: "The Best Query Language"} |> Repo.insert!
%Link{url: "http://dev.apollodata.com/", description: "Awesome GraphQL Client"} |> Repo.insert!

# Step7: setup ecto (create + migrate)
$ mix ecto.setup

You should see two pieces of items in the links table.

More

GraphQL Glance

This is a quick and simple glance to the raw document (in the references), maybe you could treat it as a brief note. Hope it’s helpful to u.

At its core, GraphQL enables declarative data fetching where a client can specify exactly what data it needs from an API. GraphQL is a query language for APIs - not databases.

REST vs GraphQL

  • Data Fetching: multiple endpoints VS single query
  • Over-fetching and Under-fetching (n+1) : fixed data structure VS given exact data
  • Rapid Product Iterations on the Frontend: adjust with data change VS flexible
  • Insightful Analytics on the Backend: fine-grained insights about the data
  • Benefits of a Schema & Type System: type system => schema, frontend and backends can do their work without further communication

More

Speech and Language Processing (3rd) Note

Paper Note

DeepLearning

NLP