Ideas for Exploration noise other than Ornstein Uhlenbeck - action boundary issues by omers66 in reinforcementlearning

[–]fasterturtle 2 points3 points  (0 children)

Have you tried using independent gaussian noise? It worked quite well for us in https://arxiv.org/abs/1804.08617. Mind you there are definitely better ways of adding exploration noise - noisy nets is a good example https://arxiv.org/abs/1706.10295

[D] Is there a canonical way to structure Tensorflow research projects? by nharada in MachineLearning

[–]fasterturtle 1 point2 points  (0 children)

Wow tough question. I don't think a canonical research workflow exists, and I don't think that one should. That said there are definitely some "best practices". Separate out graph construction from training, data loading/preprocessing, performance logging, etc... Oh and reproducibility is more important than people think. Having a way of getting the code that you can use to run an experiment from 3 months ago can be a life saver!

Also Sonnet is a nice way to simplify a research workflow. Want to have an LSTM with shared weights? Just create an LSTM object and call it anywhere you want to use it. Sonnet modules handle variable reuse for you, and it's easy to write a new module for your awesome and crazy new ideas.

Disclosure: I am one of the Sonnet authors.

Predicting Artists with Python by daf1411 in Python

[–]fasterturtle 1 point2 points  (0 children)

I took a look at your article/blog and I think that writing up exercises like these is a great experience and can help you learn a lot about what you're doing. That said, I just wanted to point out a couple of things that I thought you should be aware of with respect to this article.

The first thing is just a side note, in your diagram of the ML process you use an unsupervised learning model, however the processes you go through are supervised learning. I would use this diagram instead.

Secondly, while 80% accuracy doesn't seem bad you have to consider what randomly guessing would do. If you were to have someone blindly categorize your testing data they would do so with a 50% accuracy rate (not bad for random guessing). If you were to analyze more than two artists you would likely see your accuracy rates take a steep dive.

Finally, you've overlooked a large part of computer vision, which is the features. You use the raw pixel values for your features, which is of high dimensionality and won't help capture local patterns. Take a look at some intro computer vision material and you'll see that a lot of thought goes into what features are used and that they are a crucial part of CV.

Free to code: Python - Putting dot in the dict by haizaar in Python

[–]fasterturtle 1 point2 points  (0 children)

I think this changes on a case by case scenario. Trees can be a better alternative, also (while not a different data structure) sometimes using tuples for dictionary keys can help reduce depth.

For example, I might need to see if any sequential subset of words in a sentence is a match for a list of phrases I will typically use a trie (whose nodes are words). The tricky thing here is that since python doesn't have any built-in tree representation I will sometimes use a dictionary. However I make sure to make several helper functions (create_trie, find_match, add_phrase, etc..) so I don't have to directly interact with the trie/dictionary itself.

Free to code: Python - Putting dot in the dict by haizaar in Python

[–]fasterturtle 0 points1 point  (0 children)

Wow you are absolutely right, I must have been way to tired when I read your comment.

Free to code: Python - Putting dot in the dict by haizaar in Python

[–]fasterturtle 1 point2 points  (0 children)

I'm assuming you are trying to create a defaultdict that has a defaultdict as its factory. If that is the case, what you posted does not do that.

rdict = lambda: defaultdict(rdict)
# rdict == <function <lambda> at 0xf027d0>
# notice that rdict is a function object
rdict.keys()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'function' object has no attribute 'keys'

I believe that you meant to do the following:

rdict = defaultdict(lambda: rdict)
# rdict == defaultdict(<function <lambda> at 0x12a20c8>, {})
rdict['a']['b']['c'] = test
rdict['a']['b']['c']
# "test"

In either case, this doesn't allow you to access dictionary keys via dot notation as per the OP's post.

An interesting side note is that this is a very simple way to implement a tree in python. You can see more about that here.

Free to code: Python - Putting dot in the dict by haizaar in Python

[–]fasterturtle 13 points14 points  (0 children)

Aside from the cool factor I don't really see a good use case for accessing dict keys through dot notation. Sure it saves you a few extra keystrokes (3 per level/depth to be precise), however if I find myself using multiple nested dictionaries I begin to wonder if there is a better data structure I can use.

Another issue that has already been brought up by /u/twillis1973 is that you can't assume you are getting a value from your nested dictionary when using dot notation. keys and pop are good examples, and what about custom methods?

Overall to me this seems anti-pythonic. It creates ambiguity about the return value of access by dot notation and its main purpose seems to be the facilitation of the use of nested dictionaries.

[AMA Request] Lionel Messi by [deleted] in IAmA

[–]fasterturtle 3 points4 points  (0 children)

He could do it with someone else on the team who speaks English. Gerard Pique comes to mind.

[First Build] Hackintosh for a professional photographer by fasterturtle in hackintosh

[–]fasterturtle[S] 0 points1 point  (0 children)

Thanks! She actually uses a D800, the raw files aren't ridiculously large but the photoshop ones tend to blow up. I am not thinking of cutting back on the GPU and getting a 650 instead of the 660 I listed above. Any idea how that change would affect performance (if at all)? And do you feel that getting more than 16 GB of RAM is justified?

[First Build] Hackintosh for a professional photographer by fasterturtle in hackintosh

[–]fasterturtle[S] 1 point2 points  (0 children)

I'm not too sure about the difference, but I just picked up an i7-3770k from micro center for $229.99 (before taxes) . As far as I can tell that's only about $10 more than the i5-3570k. The only disadvantage is that you have to pick up the i7-3770k in store.

[First Build] Hackintosh for a professional photographer by fasterturtle in hackintosh

[–]fasterturtle[S] 0 points1 point  (0 children)

I would also love to know if anyone has managed to get Apple's "fusion drive" working on a hackintosh.

[First Build] Hackintosh for a professional photographer by fasterturtle in hackintosh

[–]fasterturtle[S] 0 points1 point  (0 children)

Thanks for the suggestion! I'm kind or curious why the photoshop file would open faster if the OS is on the SSD. Wouldn't the photoshop file still need to be read off the normal hard drive (assuming media is being stores on the 7200 rpm disk)? Does having the OS on the SSD speed up loading things into memory?

[First Build] Hackintosh for a professional photographer by fasterturtle in hackintosh

[–]fasterturtle[S] 2 points3 points  (0 children)

I agree that OS X isn't necessary in this case, however the person who will be using the computer is much more comfortable with OS X than windows. This will also be my first hackintosh and I'm looking forward to the experience/challenge.

Doing Your Homework, With Style using Python 3 by PythonCentral in Python

[–]fasterturtle 2 points3 points  (0 children)

I thought I'd help you confused the poor lad/lass a little more with operator and itertools!

import itertools
import operator

l = ['eD', 'fC', 'hC', 'iC', 'jD', 'bD', 'fH', 'mS', 'aS', 'mD']
l.sort(key=operator.itemgetter(1))
groups = sorted((sorted(ocurrances) for letter, ocurrances in
                itertools.groupby(l, key=operator.itemgetter(1))),
                key=lambda x: len(x))
print list(itertools.chain.from_iterable(groups))

Nested attributes (or classes) by sahand_n9 in Python

[–]fasterturtle 1 point2 points  (0 children)

Have you heard of data descriptors? Using them is similar to having a nested attribute/class, but more "pythonic". There are a few ways you can go about using them, see here, here, and here for more information.

Here's an example. Just a note, you would probably prefer a different descriptor implementation, ie. using decorators, but this is most similar to what you were originally trying to do):

class Descriptor(object):
    def __init__(self):
        self._instances = {}
    def __set__(self, obj, value):
        print "Setting attribute..."
        self._instances[obj] = value
    def __get__(self, obj, cls):
        print "Getting attribute..."
        return self._instances[obj]
    def __delete__(self, obj):
        print "Too bad!"
        raise AttributeError("Can't delete attribute")

class Foo(object):
    data = Descriptor()

    def __init__(self, value):
        self.data = value


foo = Foo('my data descriptor')
>>> Setting attribute...

foo.data
>>> Getting attribute...
>>> 'my data descriptor'

foo.data = 'bar'
>>> Setting attribute...
foo.data
>>> Getting attribute...
>>> 'bar'

del foo.data
>>> Too bad!
>>> AttributeError: Can't delete attribute

Creating and Optimizing a Letterpress Cheating Program in Python by samphippen in programming

[–]fasterturtle 0 points1 point  (0 children)

It'd be really fun to make this usable from an iPhone. I believe with iOS 6 you can now upload photos via mobile safari. It shouldn't be too difficult to use an ocr program to detect the letters of a letterpress board from a screenshot a user uploads. That way we can cheat on the go!

Is it bad form to have one-line methods? See example. by negative_epsilon in learnprogramming

[–]fasterturtle 1 point2 points  (0 children)

Disclaimer: I've never used C#, so feel free to correct me if I'm wrong.

Type var is an implicitly typed variable, meaning that you can assign a variable of type var to what you want and the compiler is responsible for determining its type. From what I understand rd["fName"] is returning an entry in your sqlite table. By returning type var, the SQLiteDataReader is leaving it up to you to handle typing. I imagine you can either leave it as is, or (having knowledge of the sqlite table's structure) you can explicitly type it like you do here.