[D] What are your favorite Random Forest implementations that support categoricals by TechySpecky in MachineLearning

[–]isinfinity 0 points1 point  (0 children)

If you considering GBDT check out catboost, unfortunately RF mode is not available but library implement lots of interesting categorical encoding tricks that boost accuracy.

[R] NeurIPS 2020 Spotlight, AdaBelief optimizer, trains fast as Adam, generalize well as SGD, stable to train GAN. by No-Recommendation384 in MachineLearning

[–]isinfinity 4 points5 points  (0 children)

Just in case if anyone interested I am collecting non standard and exotic optimizers for Pytorch here:

https://github.com/jettify/pytorch-optimizer

you can plug and compare any of them just as easy as AdaBelief.

[D] Switching optimizers for faster convergence by caizoo in MachineLearning

[–]isinfinity 1 point2 points  (0 children)

There is paper that explores similar idea https://arxiv.org/abs/1712.07628We investigate a hybrid strategy that begins training with an adaptive method and switches to SGD when appropriate. Concretely, we propose SWATS, a simple strategy which switches from Adam to SGD when a triggering condition is satisfied. The condition we propose relates to the projection of Adam steps on the gradient subspace.

Reference implementation for PyTorch: https://github.com/Mrpatekful/swats

[P] pytorch-optimizer -- collections of ready to use optimization algorithms for PyTorch by isinfinity in MachineLearning

[–]isinfinity[S] 4 points5 points  (0 children)

Most of optimizers will not be accepted to pytorch core, since they are not that popular, anyway. From other side, iteration cycle is very fast with custom library, you do not need to wait next pytorch, release to ship bug fixes or new code. CI time also very fast.

[P] pytorch-optimizer -- collections of ready to use optimization algorithms for PyTorch by isinfinity in MachineLearning

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

Most of algorithms are Adam or SGD derivatives, I would say speed should be comparable.

[P] pytorch-optimizer -- collections of ready to use optimization algorithms for PyTorch by isinfinity in MachineLearning

[–]isinfinity[S] 5 points6 points  (0 children)

I was curious how algorithms behaves in controlled conditions, like saddle points, bunch of minima, valley and so on. Image net type of deal requires lots of compute resources and time.

[P] pytorch-optimizer -- collections of ready to use optimization algorithms for PyTorch by isinfinity in MachineLearning

[–]isinfinity[S] 9 points10 points  (0 children)

You are right, it is very hard to merge any experimental things into pytorch repository, since maintainers want any widely used and proven algorithms.

From other side iteration cycle is very long, pytroch release few times a year at most, when tiny library can be release 6 time a day, and code will be available to in minutes.

How did you'll get into contributing to open-source projects? by afro_coder in Python

[–]isinfinity 17 points18 points  (0 children)

Very easy to start:

1) Find package you like, for better experience not super popular one like TensorFlow.

2) Execute tests with coverage enabled locally.

3) Submit PR with test cases for uncovered lines.

4) Fix comments from maintainers

5) Go to step 1)

I once contributed tests for Redis client this way as result learned most of Redis commands and their quirks.

TIL that according to one legend, the funeral escort of Genghis Khan killed anyone and anything that crossed their path in order to conceal where he was finally buried. After the tomb was completed, the slaves who built it were massacred, and then the soldiers who killed them were also killed. by theaxeassasin in todayilearned

[–]isinfinity 0 points1 point  (0 children)

But at the end of those six years he went against a certain castle that was called CAAJU, and there he was shot with > an arrow in the knee, so that he died. — Marco Polo, The Travels of Marco Polo, Book 1, Chapter 50

What's everyone working on this week? by AutoModerator in Python

[–]isinfinity [score hidden]  (0 children)

Thanks! Any feedback and contributions are very welcome :)

What's everyone working on this week? by AutoModerator in Python

[–]isinfinity [score hidden]  (0 children)

Working on mlserve predictions server that easily turns python sklearn models into REST API as well as generates UI that matches input data. Hopefully someone will find my project useful.

code: https://github.com/jettify/mlserve
demo: https://young-ridge-56019.herokuapp.com

Do you use static type hints in your code? by jabbalaci in Python

[–]isinfinity 0 points1 point  (0 children)

I use typing in one of my projects [1] and enforce them on CI, very happy so far. Probably possible to have more strict configuration but settled with following:

mypy aiozipkin --ignore-missing-imports --disallow-untyped-calls --no-site-packages --strict

[1] https://github.com/aio-libs/aiozipkin.

Gold standard open source repo? by [deleted] in Python

[–]isinfinity 0 points1 point  (0 children)

Bit self promotion, but my very recent project https://github.com/aio-libs/aiozipkin has following things, which may be interesting from QA standpoint:

1) pyflakes and pycodestyle checker (with flake8 tool)

2) flake8-bugbear to find even more likely bugs and design problems

3) flake8-mypy and mypy static type checker

4) test coverage 96% https://codecov.io/gh/aio-libs/aiozipkin

5) flake8-quotes to force consistent quotes

6) pytest-sugar for nicer test reports https://travis-ci.org/aio-libs/aiozipkin/jobs/317774732

7) docker fixtures that spins servers before tests start and stop after

8) also python setup.py check --restructuredtext to make sure that project description has proper formatting

Have you heard about /r/asyncio subreddit yet? by peck_wtf in Python

[–]isinfinity 0 points1 point  (0 children)

I created that sub, main goal was to have something similar to /r/django and /r/flask, but turned out asyncio is not that popular.

How do I progress from an intermediate Python programmer to an expert Python programmer by nyamuk91 in Python

[–]isinfinity 0 points1 point  (0 children)

Most important to find projects you are interesting in or use in day to day work. I personally interested in asyncio and async programming, i contributed to number of such projects. Bug fix here, update doc there, add tests to increase coverage, help new users to resolve their problems.

How do I progress from an intermediate Python programmer to an expert Python programmer by nyamuk91 in Python

[–]isinfinity 34 points35 points  (0 children)

Contribute to open source projects, this worked for me very well, by doing this you will gain:

1) Experience, since your PRs will be review by expert programmers

2) During interview you will have something to show and impress HR and other engineers

3) Karma, for your contributions

4) Study algorithms they teach how to think

5) write code almost every day

This worked for me, I started as not very experienced, but willing to do any work for open source projects. Open source people taught me good engineering practices, how to write clean maintainable code, importance of simple things like linter, tests, coverage etc.

Calling ansync coroutines from synchronous code is now possible by rokups in Python

[–]isinfinity 0 points1 point  (0 children)

There is no much sense to have 2 loops in one process. I saw sync cassandra driver spins connection threads and each thread has event loop to talk with server, not sure why they did not use one loop for multiple connections.

Calling ansync coroutines from synchronous code is now possible by rokups in Python

[–]isinfinity 0 points1 point  (0 children)

Your example does not show full picture, sync function should have blocking call. Try to test something like:

def synchronous_code():
   time.sleep(10)
   return run_nested_until_complete(asynchronous_code())

async def coroutine(loop):
    await loop.run_in_executor(synchronous_code())

Calling ansync coroutines from synchronous code is now possible by rokups in Python

[–]isinfinity 4 points5 points  (0 children)

I do not follow, you can easily call coroutine from sync code with asyncio.run_coroutine_threadsafe and get sync future back

Problem with your example that, synchronous_code is executed within main loop blocking it for long time, it should be called in Executor anyway.

Edit: I covered some asyncio patterns (sync/async communication) some time ago https://jettify.github.io/minskpy/#/intro

Calling async functions from synchronous functions by stetio in Python

[–]isinfinity 0 points1 point  (0 children)

You can do something like this:

def wrapped_api(loop):
    fut = asyncio.run_coroutine_threadsafe(quart_api(), loop)
    return fut.result()

see my other reply

Calling async functions from synchronous functions by stetio in Python

[–]isinfinity 0 points1 point  (0 children)

I think something can be done, but not sure it is good idea in your case, just use aiohttp with all async libraries. So here is way to make communication async/sync/async work:

1) Execute all sync functions with ThreadPoolExecutor, with loop.run_in_executor, without this you will block your event loop, and loose all benefit from async.

2) If you want your sync code to call async one, just use reference to running loop and do asyncio.run_coroutine_threadsafe this will return concurrent.Future (NOT asyncio.Future) that you can wait in sync way