Giter Site home page Giter Site logo

deeplearning's Introduction

DeepLearning

deeplearning's People

Contributors

tjuhwf avatar

deeplearning's Issues

ch0任务感想

环境配置

1> docker安装:不翻墙下载docker镜像简直就是龟速;不管怎样,docker还是可以正常下载了
2> tensorflow:看文档,逛社区,docker中运行tensorflow 应该是比较简单的;docker run -it -p 8888:8888 -v ~/tensorflow:/notebooks/tensorflow tensorflow/tensorflow;结论:不翻墙几乎不可能,这个地方卡了一段时间;无奈只好搞了个vpn,一切就都通了,哈哈哈!

代码

1> 语料:找不到ch0任务的语料,任务完成太晚,不知道是不是关闭了;暂用挑战任务的语料代替

DL101.py

#!/usr/bin/python

-- coding: utf-8 --

import sys

word_dic = {}
word2_list = []
file_hande = open(sys.argv[1],"r")
word_list = file_hande.read().replace('\n',' ').split(' ')

for i in range(len(word_list)-2):
if(len(word_list[i]) == 4 and len(word_list[i+1]) == 4):
tmp_list = []
tmp_list.append(word_list[i])
tmp_list.append(' ')
tmp_list.append(word_list[i+1])
tmp = word_list[i]+' '+word_list[i+1]
word2_list.append(tmp)
word_dic[tmp] = 0

for word in word2_list:
word_dic[word] = word_dic[word] + 1

new_word_list = sorted(word_dic.iteritems(), key=lambda d:d[1],reverse=True)

for i in range(10):
print new_word_list[i][0],":",new_word_list[i][1]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.