Captcha recognizing with convnet, how to define loss function

I have small research project where I try to decode some captcha images. I use convnet implemented in Tensorflow 0.9, based on MNIST example (https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/convolutional_network.py) My code is available at github https://github.com/ksopyla/decapcha/blob/master/decaptcha_convnet.py I have try to do reproduce the idea

Captcha用convnet识别,如何定义损失函数

我有一个小型的研究项目,我尝试解码一些验证码图像。 我使用Tensorflow 0.9中实现的convnet,基于MNIST示例(https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/convolutional_network.py) 我的代码可以在github https://github.com/ksopyla/decapcha/blob/master/decaptcha_convnet.py 我试图重现所描述的想法: “使用深度卷积神经网络从街景图像中识别多位数字”Goodfello

How exactly do Django content types work?

I'm really having a difficult time grasping the concept of Django's content types. It feels very hackish and, ultimately, against how Python tends to do things. That being said, if I'm going to use Django then I have to work within the confines of the framework. So I'm coming here wondering if anyone can give a practical real world example of how a content type works and how y

Django内容类型究竟如何工作?

我真的很难把握Django内容类型的概念。 它感觉非常黑客,并最终反对Python如何处理事情。 话虽如此,如果我要使用Django,那么我必须在框架的范围内工作。 所以我来这里想知道是否有人可以给出一个实用的真实世界的例子,说明内容类型是如何工作的以及如何实现它。 几乎所有我所查阅的教程(主要是在博客上)都没有真正涵盖这个概念。 他们似乎拿起Django文档离开的地方(似乎没有任何地方)。 所以你想在你的工作中使用

How to debug in Django, the good way?

So, I started learning to code in Python and later Django. The first times it was hard looking at tracebacks and actually figure out what I did wrong and where the syntax error was. Some time has passed now and some way along the way, I guess I got a routine in debugging my Django code. As this was done early in my coding experience, I sat down and wondered if how I was doing this was ineffect

如何在Django中调试,好方法?

所以,我开始学习使用Python和后来的Django进行编码。 第一次很难看到回溯,并且真正弄清楚我做错了什么以及语法错误在哪里。 现在已经过去了一段时间,我想我在调试Django代码的过程中得到了一个例程。 由于这是在我的编码经验的早期完成的,我坐下来想知道我是如何做到这一点是无效的,可以做得更快。 我通常设法找到并纠正我代码中的错误,但是我想知道我是否应该更快地做到这一点? 我通常只使用Django启用时的调试信

Set Up A Scheduled Job?

I've been working on a web app using Django, and I'm curious if there is a way to schedule a job to run periodically. Basically I just want to run through the database and make some calculations/updates on an automatic, regular basis, but I can't seem to find any documentation on doing this. Does anyone know how to set this up? To clarify: I know I can set up a cron job to do th

设置计划任务?

我一直在使用Django开发一个web应用程序,我很好奇是否有办法安排一项工作定期运行。 基本上我只想运行数据库并自动定期进行一些计算/更新,但我似乎无法找到任何有关执行此操作的文档。 有谁知道如何设置? 澄清:我知道我可以设置一个cron工作来完成这个任务,但是我很好奇Django中是否有一些功能可以提供这种功能。 我希望人们能够自己部署这个应用程序,而无需做太多配置(最好是零)。 我曾考虑通过简单地检查自上

Django development IDE

I have done a little Django development, but it has all been in a text editor. I was curious what more advanced development tools others are using in their Django development. I am used to using Visual Studio for development and really like the IntelliSense, code completion, and file organization it provides and would like to find something (or a combination of tools) that would provide some o

Django开发IDE

我做了一点Django开发,但它都是在文本编辑器中。 我很好奇他人在他们的Django开发中使用了哪些更高级的开发工具。 我习惯于使用Visual Studio进行开发,并且非常喜欢它提供的IntelliSense,代码完成和文件组织,并且希望找到可以在Django / Python环境中提供某些内容的一些(或多种工具组合)。 我使用Eclipse和普通的香草PyDev。 没有任何特定的Django功能。 我想出的最好的办法是设置一个运行配置文件来运行开发Web服

How to run py.test and linters in `python setup.py test`

I have a project with a setup.py file. I use pytest as the testing framework and I also run various linters on my code ( pep8 , pylint , pydocstyle , pyflakes , etc). I use tox to run these in several Python versions, as well as build documentation using Sphinx . I would like to run my test suites as well as the linters on my source code with the python setup.py test task. If I acheive this,

如何在`python setup.py test`中运行py.test和linters

我有一个setup.py文件的项目。 我使用pytest作为测试框架,我也在我的代码上运行各种linters( pep8 , pylint , pydocstyle , pyflakes等)。 我使用tox在多个Python版本中运行这些代码,以及使用Sphinx构建文档。 我想用python setup.py test任务运行我的测试套件以及源代码中的linters。 如果我实现了这个目标,那么我会使用python setup.py test作为在tox.ini文件中运行测试的命令。 所以我的问题是: 使用python

Method in tuple requires explicit `self` argument

I want to understand why this code works: class MyClass(object): def f(self): print "Hello" ff = f def g(self): self.ff() MyClass().g() while this doesn't: class MyClass(object): def f(self): print "Hello" ff = f, def g(self): self.ff[0]() MyClass().g() since it needs an argument self.ff[0](self) : TypeError: f() takes exactly 1 argument (0 given) Is not self.f

元组中的方法需要明确的`self`参数

我想了解为什么这段代码有效: class MyClass(object): def f(self): print "Hello" ff = f def g(self): self.ff() MyClass().g() 虽然这不: class MyClass(object): def f(self): print "Hello" ff = f, def g(self): self.ff[0]() MyClass().g() 因为它需要一个参数self.ff[0](self) : TypeError: f() takes exactly 1 argument (0 given) 不是self.ff[0] == self.f和前面的例子一样self.f

Building very large Cosine matrix

I need to build a cosine matrix (ie a matrix of cosine distances between every vector combination) for a vector set with 89,000 vectors of length 500, leading to a final 89,000x89,000 matrix. My current approach seems to be very inefficient, leading to very long processing times (eg using a vector set with 52,000 vectors of length 500 takes ~36 hours to build a 52,000x52,000 matrix). My curren

构建非常大的余弦矩阵

我需要为具有长度为500的89,000个矢量的矢量集创建一个余弦矩阵 (即每个矢量组合之间的余弦距离矩阵),从而形成最终的89,000x89,000矩阵。 我目前的方法似乎非常低效,导致处理时间很长(例如,使用52,000个向量长度为​​500的向量组需要约36小时来构建52,000x52,000矩阵)。 我目前的解决方案使用R版本3.0.1(2013-05-16),在Intel Core i7 4960X CPU @ 3.60GHz x 12平台和64GB RAM的64位版本的ubuntu 13.10上运行。 尽管

What is the common header format of Python files?

I came across the following header format for Python source files in a document about Python coding guidelines: #!/usr/bin/env python """Foobar.py: Description of what foobar does.""" __author__ = "Barack Obama" __copyright__ = "Copyright 2009, Planet Earth" Is this the standard format of headers in the Python world? What other fields/information can I put in the header? Python gurus

什么是Python文件的常见标题格式?

我在关于Python编码准则的文档中遇到了以下Python源文件头格式: #!/usr/bin/env python """Foobar.py: Description of what foobar does.""" __author__ = "Barack Obama" __copyright__ = "Copyright 2009, Planet Earth" 这是Python世界中标题的标准格式吗? 我可以在标题中添加哪些其他字段/信息? Python专家分享您的准则,以获得良好的Python源代码头:-) 它的Foobar模块的所有元数据。 第一个是模块的doc

How to convert a string list into an integer in python

This question already has an answer here: Get a list of numbers as input from the user 16 answers 使用split()在逗号分割,使用int()将其转换为整数: user_lst = map(int, user.split(",")) There's no ' to remove in the list. When you print a list, since it has no direct string representation, Python shows you its repr —a string that shows its structure. You have a list with one item, the

如何将一个字符串列表转换为Python中的整数

这个问题在这里已经有了答案: 获取用户输入的16个答案的数字列表 使用split()在逗号分割,使用int()将其转换为整数: user_lst = map(int, user.split(",")) 有没有'列表中删除。 当你打印一个列表时,由于它没有直接的字符串表示,所以Python向你显示了它的repr -a字符串,它显示了它的结构。 你有一个项目列表,字符串12,33,223 ; 这是[user]所做的。 您可能想要用逗号分割字符串,如下所示: user_list = user_