Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
The map

/r/IPython
https://redd.it/5khf6c
alot of .PY scripts I found. Dont know what they do but thought somebody here would like to look over them.
http://cage.owltux.com/?dir=script/script%20python

/r/Python
https://redd.it/5ki1ze
I accidentally uploaded my secret key onto a public github repo for a trivial practice app--am I under any serious threat for anything?

It was a side project I did for practice, but would like to keep it on github to keep record of my progress.

What sort of risk am I taking in making my secret key available?

side question: when uploading a django app onto GH, what sort of security measures should I take from now on? What belongs in the .gitignores of django apps?

/r/django
https://redd.it/5kix2v
[D] How to train generative adversarial networks

We have had a few posts here before, and the [notes of the talk at NIPS](https://github.com/soumith/ganhacks) are useful, and there are some other great "how to" [resources](https://github.com/shekkizh/neuralnetworks.thought-experiments/blob/master/Generative%20Models/GAN/Readme.md). There is also the [Torch blogpost on the topic](http://torch.ch/blog/2015/11/13/gan.html).

I have generated images that look good. I have toyed with tons of GAN variants.

But I still feel like I have no idea how to train a GAN in any sort of rigorous manner. To me it seems like the most important factor in generating visually understandable images is some strange and exploratory architecture balancing act, which appears completely arbitrary. I train one GAN to equilibrium and end up with trash images, but change a tiny thing in the architecture and reach a very similar equilibrium (ie the G and D training curves look the same) but have nice images.

This suggests to me that what we are actually doing is (over)fitting models based on human visual interpretation, not model metrics. This is very "human in the loop" and not theoretically satisfying. And more frustratingly, it is not discussed even in the few articles and blogposts on GAN hacks and methods. I wasn't at NIPS so I don't know if the workshop covered more than the git.

Mode collapse and "stability" don't seem to explain my experiences. It kind of feels more like model hacking. I know my colleagues feel similar frustrations, like we are all just randomly wandering around image space until we stumble upon a training method that lands us close to the image manifold and then it magically starts working.

I really want to be told I am just missing something that should be obvious.

So, is there any rigorous way to train a GAN? Where I can look at my curves and my gradients and my activations and just *know* I will end up with quality images?



/r/MachineLearning
https://redd.it/5kj566
What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.


/r/Python
https://redd.it/5kjv9n
Running django models on a server

I've currently built a data collector script that requests data from an API and stores it in a mongo database. Eventually I want to display this data via a django app however first i'd like to host the script on a server where it can collect data without my computer being on.

Later I will connect my django app to the db that is hosted on the server. However for now I want to know the best way to host my data collector and db.

Would you guys recommend apache ?

NB I'm new to hosting scripts on servers/ django, so any noobie notes would be great

EDIT: Can i run it directly through django with it's own server ?

/r/django
https://redd.it/5kf504
jsonencoder

hello again dont mean to be a pain in the rear but i really need help serializing sqlalchemy data to json to be able to use in jquery

class User(db.Model):

__tablename__ = 'user'

id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(100), unique=True)
email = db.Column(db.Binary)
password = db.Column(db.Binary)
role = db.Column(db.String(8))
profilepic = db.Column(db.String())

picture = db.relationship('Picture', backref='owner', lazy='dynamic')
comment = db.relationship('Comment', backref='user', lazy='dynamic')

def __init__(self, username, email, password, role, **kwargs):
self.username = username
self.email = email
self.password = password
self.role = role

i have tried marshmallow but its hard for me to understand i would really appreciate the help

/r/flask
https://redd.it/5klglf
sklearn 17 missing mlp for NN's

Earlier today I downloaded sklearn 17, and Im noticing that its missing mlp for neural networks. Is this a module that is part pf the core? or is it standalone?

/r/pystats
https://redd.it/403265
Ryuzaki / L (Death note) voice changer script Python

I want to have a script in python that transforms my voice into L voice in Death note. I know how to achieve this, in fact it's pretty simple : - duplicate 2 time the voice - increase the pitch of one - deacrease the pitch of an another one

The problem is that i didn't found any software that can make this in LIVE, (so i can use this in skype or teamspeak)

So I want to make a script in python, that : - take the microphone input - make the transformation as defined above - return the microphone image in a output so i use it in live

My question is with what module/library can i make this script

Thx.

/r/Python
https://redd.it/5km1wj
django-markdownx not compiling html to model database

I've been struggling trying to get [django-markdownx](https://github.com/adi-/django-markdownx) to work in a django project. I am able to get the markdown preview to show the compiled markdown in the admin form. However, it does not appear the markdown is being compiled when saved to the model.

Here are two screen shots showing the [admin preview](https://gitlab.com/ahaboverboard/beblog/uploads/0a91e36c838e10bfcf9c479551093b46/Screenshot_from_2016-12-27_23-42-53.png) and the [template](https://gitlab.com/ahaboverboard/beblog/uploads/e50bf8b3bff71300d3bfdedaa7568351/Screenshot_from_2016-12-27_23-44-33.png) still showing markdown

You can view the code at https://gitlab.com/ahaboverboard/beblog/tree/master with the relevant files being the [admin.py](https://gitlab.com/ahaboverboard/beblog/blob/master/blog/admin.py), [models.py](https://gitlab.com/ahaboverboard/beblog/blob/master/blog/models.py), and the [post_detail.html template](https://gitlab.com/ahaboverboard/beblog/blob/master/blog/templates/blog/post_detail.html).

Looking at the django-markdownx readme I'm unsure what I'm missing. Current guesses are the save_model function in the ModelAdmin is missing something or that using django-markdownx in django admin will require making a custom admin form. Any thoughts on best way forward?

/r/djangolearning
https://redd.it/5kp16u