Skip to content

How to efficiently draw a plot of a torch.nn model?

I’m exploring neural networks, and I want to model some pictures with neural network. Picture is a function that maps pixel coordinates to color, so I make my network also with 2 input variables (x, y) and 1 (shade) to 3 (R, G, B) output coordinates. For example, like this: Now, I plot it like this: But…

Translating python raw string / regex to ruby

I’m currently trying to translate a python script to ruby. Now I’m stuck on a part that uses a raw string for a regex. This is the original python code: This is my attempt to translate it to ruby: Unfortunately I must be doing it wrong because I get this error: I also tried: But it results in the …

get p value and r value from HuberRegressor in Sklearn

I have datasets with some outliers. From the simple linear regression, using I can get coefficient, intercept, r_value, p_value, std_err But I want to apply robust regression method as I don’t want to include outliers. So I applied Huber regressor from Sklearn, from that, I can get, coefficient, interce…

Extract Summary Values from ARIMA

I faced the following issue after running ARIMA model: How do I extract Prob(Q) and Prob(H) values from ARIMA Summary Table? For example, I can easily obtain AIC by typing: Unfortunately, I could not find properties for Ljung-Box and Heteroskedasticity here. Do you know how to get them easily? Answer The summ…

Replacing a window with a new one- Python tkinter

I’m creating a quiz game in Pythonn tkinter. I’m using my original window, called window in the beginning of the program. Then, if the user clicks on the START button, window gets replaced with window2 and the buttons that get created in the App class are displayed on window2. When I do that, it t…

Python try/finally wtih sys.exc_info()

I’m trying to write a python job that which I will be using in all the other jobs to capture the job start time and when a program finishes successfully or with some issues, I capture the error details and load the details into a table. Program I’m using the job I’m trying to capture the err…