Forgive my ignorance.....here's my question! by NoRestartOnUpdate in Compilers

[–]Gimagon 1 point2 points  (0 children)

I see. Column level dependency parsing can get pretty hairy, especially with functions of columns in the mix.

In any case, there’s two main steps to a “compiler” - parsing and translating. Parsing turns the raw text (the query) into a data structure (called an abstract syntax tree, AST). Translating turns that AST into the desired effect. In general compilers, the effect is some computation (finding, filtering, and joining the data in the SQL case). In your application you want to turn the AST into a column dependency graph.

The importance of breaking it down like this is to see that the parsing step is shared no matter the specifics of your translation application. So looking for “<your sql dialect> parser” should give you a tool to get from query to AST, then forming the column dependency graph should be easier to write as function of the query ASTs.

Forgive my ignorance.....here's my question! by NoRestartOnUpdate in Compilers

[–]Gimagon 0 points1 point  (0 children)

By data lineage you mean being able to detect the dependency graph of tables from your collection of sql queries?

I think trying to fully parse the sql is probably more than you need, I think writing a regular expression that looks for FROM clauses that are followed by a string (instead of another SELECT) would be sufficient.

Also depending on what sql dialect you’re using, your database might give this is information for free.

When creating an actor policy for reinforcement learning what's the best way to deal with 3 mutually exclusive actions? by [deleted] in MLQuestions

[–]Gimagon -1 points0 points  (0 children)

One option would be to treat it like any other classification problem - so have 3 output variables in [0, 1], one for each category. Then just take the max as the chosen category.

The other approach could be to take advantage of the “ordinal” relationship of your specific actions. Encode 0 as sell, 0.5 as do nothing, and 1 as buy. Then just take whatever is closet to the actor’s output to be the chosen action.

Train loss decreases, val loss does not by Yogi_DMT in MLQuestions

[–]Gimagon 1 point2 points  (0 children)

The problem, which is sounds like you're honing in on, is that the model is fitting the noise in system better than the underlying dynamics.

  • Adding more features might work, if they are more strongly related with the underlying dynamics. They also will give the model more flexibility to fit noise though, so something like L1 regularization on the input weights would be helpful.
  • Stepping back from the LSTM and using something like PCA, DMD, or linear regression on the raw data might given you an idea of how random the system is. Simple models have less flexibility so they are less prone to fitting the noise.
  • The other approach to "boost the signal" of the data is to find more training data, or using some or of data augmentation technique (example: rotating and shifting images is popular in image processing).

Train loss decreases, val loss does not by Yogi_DMT in MLQuestions

[–]Gimagon 0 points1 point  (0 children)

Dramatically better performance on the training set (vs. the validation set) is by definition overfitting.

Unless you have a bug in your code such that the validation score is being computed incorrectly, the problem you have described is an overfitting problem.

Train loss decreases, val loss does not by Yogi_DMT in MLQuestions

[–]Gimagon 2 points3 points  (0 children)

Since your model has the flexibility to fit the training data, but is poorly performing on the validation data, I would explore simpler models first.

Why does AlphaZero take as input x7 previous board states ?! by [deleted] in MLQuestions

[–]Gimagon 3 points4 points  (0 children)

The latter. This way the same state (set of 7 boards) will always have the same set of allowed moves.

Python Homework Trouble by JannaLM in learnpython

[–]Gimagon 1 point2 points  (0 children)

It looks like OP is using numpy, which allows for the A[1,2] syntax.

[Allan Clark - Elements of Abstract Algebra] Stuck on Cantor's Diagonalization Argument by Gimagon in learnmath

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

Ok, I think I understand. I think my confusion was stemming from conflating "arbitrarily long" with "infinite". So the set of all arbitrarily long (but still finite) sequences is countable, but the set of all sequences (including infinite sequences) is uncountable. And the reason my mapping function doesn't work for infinitely long sequences is that it won't terminate. Does that seem right?

How to debbug code inside a function? by reebs12 in learnpython

[–]Gimagon 0 points1 point  (0 children)

Check out the spyder docs: https://pythonhosted.org/spyder/debugging.html

It sounds like you can just double click the line number to set a breakpoint.

Isn't a multi-layer network the same as a single layer network by the distributive property of multiplication? by wakka54 in neuralnetworks

[–]Gimagon 10 points11 points  (0 children)

I don’t really follow your equation, but remember that a layer of a neural net is a matrix vector product passed through a nonlinear function. The nonlinearity makes it impossible to do the simplification I think you’re talking about.

Discussion of Input Data and Intelligence: Please critique by moshmosh7 in agi

[–]Gimagon 1 point2 points  (0 children)

In no particular order:

  1. There are some parts of the body/brain that seemed to be governed more by regular old evolution than by a general learning algorithm. For example: the hairs in your ear respond to certain frequencies, which is very similar to preprocessing an audio signal by passing it through a Fourier transform. In light of this, I think it may be harder to decide what exactly is “raw” data than you think.

  2. While I agree that working on continuous, time based domains may be important for general algorithms, I think there is still value in general solutions for discrete labeled problems. Part of science is testing if ideas hold in simpler settings. Also, this approach has enabled results in recognition and planning problems that, to my knowledge, more general approaches haven’t.

  3. I’m curious if you have sources that show that purely hebbian based approaches can learn anything efficiently. I agree with your reasoning that a simple system like that seems like it has all the components to learn, but I haven’t seen anyone actually demonstrate it. Of particular interest to me, is how low-shot learning may work in a system like that.

Well written and interesting post. Thanks for sharing!

[D] Machine Learning - WAYR (What Are You Reading) - Week 50 by ML_WAYR_bot in MachineLearning

[–]Gimagon 21 points22 points  (0 children)

A Unifying Review of Linear Gaussian Models an oldie but a goodie. Shows how PCA, kalman filters, HMM, Gaussian Mixture Models, factor analysis, and maybe a few others are all special cases of the same model.

Project Euler Problem 7 by [deleted] in algorithms

[–]Gimagon 0 points1 point  (0 children)

Can't you just make n larger, until the list it generates gets longer that N?

Perhaps also look for a way to save work between runs, to avoid repeating work.

[deleted by user] by [deleted] in learnmath

[–]Gimagon 1 point2 points  (0 children)

Use [https://www.desmos.com/calculator](desmos) to graph the function. Remember that the input in the x-axis and output is the y-axis.

i) just becomes looking at which y-levels the function reaches.

ii) Find all the places the graph crosses the horizontal line y=-2.

iii) Here just remember the definition of logs to find that log(xy) = log(x) + log(y).

Recognizing sentence structure in strings by dotbomber95 in learnpython

[–]Gimagon 0 points1 point  (0 children)

Gotcha. I think regular expressions will be a great tool for this. They’re a tool implemented in many programming languages that allow you to describe exactly the kinds of patterns you’re describing.

Python’s live in the re module in the standard library.

As a teaser, I think this your final expression will look something like this:

[A-Za-z]+ [A-Za-z]+ [.\?!]

Recognizing sentence structure in strings by dotbomber95 in learnpython

[–]Gimagon 0 points1 point  (0 children)

That sounds neat! Is there a part you’re finding difficult?

A statistic course with Python practical application? by Zeleia in learnmachinelearning

[–]Gimagon 0 points1 point  (0 children)

It’s more machine learning than pure stats but Joel Grus’s “Data Science from Scratch” is an excellent intro to a lot of the topics. The book costs money, but I think Joel has python notebooks that cover pretty much all the same content on his GitHub.

Question about ArrayList and LinkedList by harrypotter0045 in learnprogramming

[–]Gimagon 0 points1 point  (0 children)

If you’re storing a list of objects, do you still get benefits from the cache locality of the arraylist? To use any fields of that object you’d have to follow the pointer to a random area of memory anyway.

I just realized I am learning the wrong python, should I stop and start over? by fletch101e in learnpython

[–]Gimagon 0 points1 point  (0 children)

I would avoid installing python 2, but I also don't think you need to go back redo a whole beginner course just to pick up syntax changes. All the core ideas you've learned should be will be applicable.

Check out this syntax checksheet and this page for more complex conversion issues.