惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

Jupyter

SSL 认证莫名其妙报错了,需要引起警惕吗? - V2EX 这是什么 jupyter 插件,感觉挺酷 - V2EX 现在人工智能专业这么火,大家 jupyter 常用的一些插件和功能是啥? - V2EX pycharm 的里的 jupyternotebook 能断点调试吗? - V2EX Jupyter Notebook 到底是用来干啥的? - V2EX pycharm 里连接远程 jupyter,自动补全怎么搞? - V2EX 单元格如何取消关联 - V2EX jupyter-notebook 内置环境变量问题 - V2EX Jupyter 里有什么插件 / Kernel 可以实现类似 ob-http 的功能 - V2EX 如何计算重复率统计? - V2EX 如何在内网环境从 Windows SSH 访问 Linux 服务器 - V2EX anaconda3 环境下,在 cmd 输入"jupyter lab"显示"Exception: Jupyter command `jupyter-lab` not found." - V2EX jupyter 中通过 ctypes 调用 printf()时,不显示 printf()打印内容 - V2EX jupyter-nbconvert.exe --generate-config 报错 UnicodeEncodeError: 'gbk' - V2EX jupyter 转 markdown 要是能内嵌图片就好了 - V2EX JupyterLab 插件功能小贴士 - V2EX Jupyter 的输出窗口可以同时动态刷新两种图吗? - V2EX 最近整理了一些 Jupyter book 文档 - V2EX jupyter 怎么读 - V2EX 使用 Jupyter notebook 生成柱状图失败,问题出在哪?? - V2EX 求助, Jupyter 已经启动,但是网页无法显示 - V2EX 用 Jupyter 写非 Python 体验如何? - V2EX 写了一些 Jupyter notebook 的扩展插件 - V2EX Supervisor 无法停止 Jupyter Notebook - V2EX
Jupyter 上的 Lua 与 torch7 - V2EX
irainy · 2016-01-02 · via Jupyter

>> 原文地址 <<


Jupyter & IPython

Jupyter是一个基于IPython Notebook的项目,我记得最开始 Jupyter 的目标还是致力于在 IPython Notebook 上通过扩展各种内核实现对不同编程语言的支持,但是现在再来看已经变成了“支持跨语言的交互式数据科学和科学计算”:

support interactive data science and scientific computing across all programming languages.

我一直还是把 Jupyter 当做一个好用的 Markdown 编辑器以及其他编程语言的虚拟运行环境来用,并没有关注过项目具体的发展。前段时间Github 支持渲染.ipynb文件(测试:test_jupyter.ipynb),以及后来 Google 开源的Deepdream项目,通过 IPython Notebook 可视化图片分类的深度学习过程中相邻神经网络层次之间的信息传递(我怀疑是不是这个大新闻促使了 Jupyter 向数据科学方向的转变?),可以看到 Jupyter 挑了一个热门或者正确的方向去发展。我这次打算用它来做LuaTorch7的学习笔记与交互展示,再去看官方文档,甚至已经开始脱离IPython走向独立。

Lua & Torch & iTorch

提到 Lua 很多人第一反应就是“写游戏的”(我最初接触它也是因为Cocos2d-Lua), Cocos2d-x 中的 Lua 只是 C/C++的 binding , Lua 的定位本身就是跨平台嵌入式脚本语言。 Lua 可能并不像其它语言那么热门,我看到有人认为“说 Python 是 Toy Language 是因为你没用过 Lua ”:P。国内社区似乎不怎么活跃,在用的人仍然在用,不用的人也有大把大把新的语言和框架涌现出来可供选择。在国内提到 Lua 不得不提的云风和他的天网-skynet;最近锤子赞助了OpenResty也就是Nginx_lua;之前上过纽约时报neuraltalk(自动生成场景图片的文字描述)从 Python+numpy 转到 Torch (neuraltalk2)。这些是进入我视线范围内的 Lua 的进展,也就是集中于后端服务程序和机器学习(数据科学)。

Torch 之于 Lua ( LuaJIT )就像 Numpy 之于 Python ,不仅如此, Torch 还提供了神经网络模型和 GPU 的支持。为了更方便调试和展示运算过程, Facebook 开源了iTorch - IPython(Jupyter) Kernel for Torch ,其中可视化展现的部分由Bokeh.js提供,效果如下:

iTorch ScreenShoot

安装步骤

System: Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-67-generic x86_64)

1. install torch

基本上按照官网的步骤就可以了,时间会比较长,尤其是在网速比较慢的时候:

# in a terminal, run the commands
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
git clone https://github.com/torch/distro.git /torch --recursive
cd /torch; ./install.sh

上面的步骤会先安装 LuaJIT 和 Lua 的包管理工具Luarocks

2. install Jupyter

按照Jupyter 文档,如果没装pip3先装起来:

sudo apt-get install build-essential python3-dev
# 还有下面这一步
sudo apt-get install python3-pip

然后安装 Jupiter (国内网络记得换国内 pip 镜像):

pip3 install jupyter -i http://pypi.douban.com/simple

3. install iTorch

首先安装ZeroMQ依赖:

sudo apt-get install libzmq3-dev

然后下载安装 iTorch :

git clone https://github.com/facebook/iTorch.git
cd iTorch
luarocks make

4. Running a notebook server

首先查看是否存在 Jupyter 配置文件,若没有则新建一份:

ls ~/.jupyter
# 如果没有 jupyter_notebook_config.py 则执行
jupyter notebook --generate-config

准备 Hased Password :

# IPython
from notebook.auth import passwd
passwd('mypassword')
# Output => 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'

更改 ~/.jupyter/jupyter_notebook_config.py

# 去掉 c.NotebookApp.password 注释
c.NotebookApp.password = u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False

5. Run itorch & Hello iTorch

一切准备就绪,运行itorch notebook

感兴趣的可以尝试一下:Hello iTorch,合理使用,切勿乱搞~Password('rainy.im')