python – Fast bruth force numpy array combination

I want to extract combinations of numpy arrays in that way:

from itertools import combinations
import numpy as np

X = np.array(np.random.randn(4, 6))
combination = np.array((X(:, (i, j)) for i, j in combinations(range(X.shape(1)), 2)))

Is there a way to speed? My array has a shape of 200×50000.

[WTS] Cloudarion Fast, Stable SSDVPS Hosting + instant installation!

https://cloudarion.com/ service is the perfect solution.

Cloudarion has been a major presence in the Web Hosting market since 2011. All of our staff is in-house and we pride ourselves on operating our own networks and infrastructures. If you add our high quality to the potency of SSDVPS hosting, you will receive a winning package. We have always been proud of our 99.9% uptime on VPS systems.

Check out Cloudarion SSDVPS hosting packages:

SSDVPS 2 hosting plan
RAM – 2 Gb
SSD – 20 Gb
OS – Windows server, CentOS, Debian, Linuxmint, Scilinux or Ubuntu.
Price $20/month

SSDVPS 4 hosting plan
RAM – 4 Gb
SSD – 30 Gb
OS – Windows server, CentOS, Debian, Linuxmint, Scilinux or Ubuntu.
Price $40/month

Payment methods accepted: Paypal, Payza, Bitcoin, WebMoney, Payoneer.

Hard drives are in a RAID 10 redundant array to ensure your data remains safe!
Local and Backup on remote server! Your VPS container will be on local RAID-10 Storage Array’s for the fastest & most reliable storage architecture for your websites. RAID-10 technology offer a staggering boost in input/output operations per second (IOPS).

Need help? Contact with our technical support.

https://cloudarion.com/

.(tagsToTranslate)webmaster forum(t)internet marketing(t)search engine optimization(t)web designing(t)seo(t)ppc(t)affiliate marketing(t)search engine marketing(t)web hosting(t)domain name(t)social media

complexity theory – Need help with a very specific Greedy Algorithm. Are there fast solutions?

i need help for a specific problem i have at work.

You have N number of rows in an array, each with some distribution of Numbers that range from 0 to N.Given an array of size 1000:

Row 1 might look like: (1,288,399,784,456,994).

Row 2 might look like: (4,784,123,8)

For each each element in each row, we take the mod 8, and obtain a distribution. In this case, it would be (3,1,1,0,0,0,0,1) , where each element represents the sum of that the values with that mod index. (3 elements had %8 = 0)

Row 2’s distribution would look like (2,0,0,1,1,0,0,0)

We define the max of this list to be the ‘size’ of the row. In this case, the max size would be 3. The overall goal is to sum up the lengths of each row and achieve a minimum total size.

One Caveat is that we are able to swap any two numbers. In the original example, we can swap 288, 784, or 456 with some other index, lets say 581 with 784. Now, our distribution would look like (2,1,1,0,0,1,0,1), and we’ve successfully reduced the size of this row. However, any other row containing 581 or 784 must also be swapped, so we might have introduced a greater size to other rows.

For example, row 2 now looks like (4,581,123,8) after the swap. Now row 2’s distrbution looks like: (1,0,0,1,1,1,0,0). In this case, we might have decreased the size of row 2 as well! However, you can imagine that this might have just as well also increased the size of many other rows, so the overall size would increase.

I’m trying to figure out if there is a fast/greedy way to figure out what the optimal swaps are to minimize the sum of all the sizes. I’m lacking context on if there are any algorithms i should look at that solve this kind of problem. Please let me know if the clarification is necessary.

[WTS] Get your super fast OpenVZ VPS starting from $5.83: Bulgaria, USA, Canada locations.

NEW! Budget Linux VPS as low as $5.83 per month:

Locations:
Germany, Switzerland, Netherlands, Bulgaria (100 Gbps DDoS Protection), USA – Miami (FL), USA – New York (NY), Canada (480 Gbps DDoS Protection).

************************************************** ********************************
Here is the promo:

XMASQH25OFFHOST -25% SHARED RESELLER VPS AND COMODO POSITIVE SSL –
Recurring 2 more times!

—-
XMASQH12OFFDEDI -12% – any billing cycle, Lifetime recurring discount on
ALL SWITZERLAND AND USA DEDICATED SERVERS!

Please note the discount is visible on the Review & Checkout step.
And Comodo Positive SSL certificate!
************************************************** ********************************
Linux OpenVZ (Budget) VPS (LE)

OpenVZ Light Edition VPS
1 GB Dedicated memory
20 GB Disk space
500 GB Bandwidth
Full Root access
1 IP address
CentOS/Debian/Ubuntu
$5.83 PER MONTH
(applies to annual payment)
ORDER NOW

Need another Linux VPS? Check here: https://click.pstmrk.it/2ts/www.QHos…Awe/lF-7kUdPWS

Desiderate Instant Managed VPS? Here you are: http://www.qhoster.com/cpanel-managed-vps.html

Current promotions:

***********************************************
Discounts for all hosting and all VPS plans and Comodo Positive SSL certificate:

QHSPRING33
Recurring 33% OFF!
(applies to any billing cycle)

***********************************************
QHoster payment options:

WebMoney, Perfect Money, Bitcoin, NETELLER, Payza (formerly Alertpay), Skrill (formerly Moneybookers), Litecoin, Darkcoin (DRK), SolidTrust Pay, cashU, Ukash, Payeer, OKPAY, EgoPay, paysafecard, Alipay, MoneyGram, Western Union, SOFORT Banking, QIWI, Alfa Click, Sberbank Rossii, Promsvyazbank (PSB), Svyaznoy, Przelewy24, Interac, Boleto Bancario, MercadoPago, PagSeguro, OneCard, DaoPay, Fortumo.

Learn More about Payment options here:
http://www.qhoster.com/payment-methods.html

Windows 7 & 2003/2008 Server in Minutes
Choose your payment option, choose your server location and get your best Windows VPS!

Instant Setup! Ready in 20 minutes!

Visit QHoster now.

cPanel Shared Webhosting
CR2QS5B85D30% OFF!
Applies to all shared and VPS plans, 3+ month period of order!

VPS and Dedicated Server
Personal voucher for $50
GHR8WY5P4P
(applies to annual billing cycles)

Windows RDP VPS
– Managed & Scalable – Instant RDP VPS Upgrades – CPU, RAM etc.
– Full Adminstrator Access to Your Windows RDP VPS
– Use Windows Server & 7 Remotely Like Your Desktop Computer
– Choice: UK,USA,Canada,France,Germany,Netherlands,Switzerla nd

Windows VPS RDP (1)
2 CPU Cores (Intel Xeon)
1.5 GB Dedicated Memory
60 GB Disk Space
1 TB Monthly Bandwidth
1 GBit/s Internet Port
1 IP (additional 64 IPs)
Price $19.96/mo
ORDER HERE

Windows VPS RDP (2)
3 CPU Cores (Intel Xeon)
3 GB Dedicated Memory
120 GB Disk Space
2 TB Monthly Bandwidth
1 GBit/s Internet Port
1 IP (additional 64 IPs)
Price $39.92/mo
ORDER HERE

Windows VPS RDP (3)
4 CPU Cores (Intel Xeon)
4.5 GB Dedicated Memory
180 GB Disk Space
3 TB Monthly Bandwidth
1 GBit/s Internet Port
1 IP (additional 64 IPs)
Price $59.88/mo
ORDER HERE

Windows KVM Servers

Windows RDP VPS – KVM 1
1.5 GB Dedicated memory
60 GB Disk space
1000 GB Bandwidth
Administrator RDP access
1 IP address
Windows Server 2008/2012/2016
$24.95/m
ORDER HERE

Windows RDP VPS – KVM 2
3 GB Dedicated memory
120 GB Disk space
2000 GB Bandwidth
Administrator RDP access
1 IP address
Windows Server 2008/2012/2016
$49.90/m
ORDER HERE

Have questions?
Feel free to contact us:
https://www.qhoster.com/clients/subm…tep=2&deptid=1

.(tagsToTranslate)webmaster forum(t)internet marketing(t)search engine optimization(t)web designing(t)seo(t)ppc(t)affiliate marketing(t)search engine marketing(t)web hosting(t)domain name(t)social media

is there a fast way to find that the uploaded image is similar to an image that exists in a specific folder that contains thousand images?

from cv2 import cv2
import numpy as np
import os
import io
import flask
from flask import Flask,request, jsonify

app = flask.Flask(__name__)
app.config(“DEBUG”) = True
path = ‘images’

@app.route(‘/check’, methods=(‘POST’))
def api_id():
f = request.files(‘imagefile’).read()
npimg = np.frombuffer(f,np.uint8)
captured = cv2.imdecode(npimg,cv2.IMREAD_COLOR)
myList = os.listdir(path)
print(‘Total Classes Detected’, len(myList))
for cl in myList:
image_to_compare = cv2.imread(f'{path}/{cl}’,0)

# Initiate BRISK descriptor
BRISK = cv2.BRISK_create()

# Find the keypoints and compute the descriptors for input and training-set image
keypoints1, descriptors1 = BRISK.detectAndCompute(image_to_compare, None)
keypoints2, descriptors2 = BRISK.detectAndCompute(captured, None)

# create BFMatcher object
BFMatcher = cv2.BFMatcher(normType = cv2.NORM_HAMMING,
crossCheck = True)

# Matching descriptor vectors using Brute Force Matcher
matches = BFMatcher.match(queryDescriptors = descriptors1,
trainDescriptors = descriptors2)

# Sort them in the order of their distance
matches = sorted(matches, key = lambda x: x.distance)

number_keypoints = 0
if len(keypoints1) = 50 :
r1 = {“ID”: os.path.splitext(cl)(0) ,”SIMILAR”:”true” }
return jsonify(r1)

r2 = {“SIMILAR”: “false”}
return jsonify(r2)

app.run()

performance – C++ Fast Fourier transform

This is a very simple FFT, I am wondering what I can do to make this faster and more memory efficient from the programming side (better data types, and maybe some tricks like unrolling loops or using the preprocessor if that is useful here), and not by using a more efficient mathematical algorithm. Obviously I would appreciate advice on best practices as well.

#include <stdio.h>
#include <vector>
#include <iostream>
#include <complex>
#include <cmath>
#include <algorithm>

#define N 1048576
#define PI 3.14159265358979323846

/*
Creating the table of all N'th roots of unity.
We use notation omega_k = e^(-2 pi i / n).
*/
template<typename U>
std::vector< std::complex<U> > rootsOfUnityCalculator() {
    std::vector< std::complex<U> > table;

    for (size_t k = 0; k < N; k++) {
        std::complex<U> kthRootOfUnity(std::cos(-2.0 * PI * k / N), std::sin(-2.0 * PI * k / N));
        table.push_back(kthRootOfUnity);
    }

    return table;
}

/*
Fast Fourier transform, T is the precision level, so float or double.
table is a look up table of the roots of unity. Overwrites the input.
For now only works for N a power of 2.
*/
template<typename T>
void FFT(std::complex<T>* input, const std::vector< std::complex<T> >& table, size_t n) {

    if (n % 2 == 0) {
        // Split up the input in even and odd components
        std::complex<T>* evenComponents = new std::complex<T>(n/2);
        std::complex<T>* oddComponents = new std::complex<T>(n/2);

        for (size_t k = 0; k < n/2; k++) {
            evenComponents(k) = input(2 * k);
            oddComponents(k) = input(2 * k + 1);
        }

        // Transform the even and odd input
        FFT(evenComponents, table, n/2);
        FFT(oddComponents, table, n/2);

        // Use the algorithm from Danielson and Lanczos
        for (size_t k = 0; k < n/2; k++) {
            std::complex<T> plusMinus = table(N / n * k) * oddComponents(k); // omega_n^k = (omega_N^(N/n))^k = omega_N^(Nk/n)
            input(k) = evenComponents(k) + plusMinus;
            input(k + n/2) = evenComponents(k) - plusMinus;
        }

        delete() evenComponents;
        delete() oddComponents;

    } else {
        // The Fourier transform on one element does not do anything, so
        // nothing needed here.
    }
}

int main() {
    std::complex<double>* input = new std::complex<double>(N);

    for (size_t k = 0; k < N; k++) {
        input(k) = k;
    }

    const std::vector< std::complex<double> > table = rootsOfUnityCalculator<double>();

    // Overwrites the input with its Fourier transform
    FFT<double>(input, table, N);

    delete() input;

    return 0;
}

3d – Fast self collision/intersection detection algorithm/library for tetrahedral meshes?

I want to play with deformation of tetrahedral mesh (soft-body simulation) but i don’t want to implement self-collision detection stuff manually. Can anyone suggest me a library for this problem? I found SOFA collision detection but i’m not sure that it fits for self-intersection of tet mesh.

If there are no good library for this problem, can anyone suggest me good algorithm for self-collision detection? As far as i can understand, something like BVH of tetrahedra can help me, but it would be great if somebody with expertise shows me right direction

Fast international WP hosting for small site

Hello,
I have a small wordpress website, <4k monthly visitors, serving about 2 MB per page, total 8 pages.

It is a hotel website so it is i… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1839108&goto=newpost

I will create 1million GSA SER backlinks your website google fast ranking for $5

I will create 1million GSA SER backlinks your website google fast ranking

Hi!! Thanks for landing my gig.

Here, I am offering you GSA SER High quality verified backlinks.

Backlinks are one of the most powerful things for ranking a top positions in any search engine. Backlinks, inbound links, external links and link building are all referring to the process of getting other sites to

link to your website.

I will provide:

  • Report with excel.
  • Link Mix of do follow.
  • Your keyword(s) as anchor text.
  • 100% Quality Backlinks.
  • Permanent Connection.
  • Fast Delivery.
  • YouTube & Amazon Store Promotion by 1M+ Backlinks.
  • Order will be delivered and Traffic will start within 24 hours.
  • Real Visitors, No bots or Spam.
  • Direct traffic source.
  • 100% Ad-sense safe.
  • Google updates safe.

Use of my backlinks for:

  • Different types of Website.
  • YouTube video.
  • Amazon / Blogging / affiliate marketing.
  • Social Media Accounts.

Note: Don’t forget to select Extra for fast delivery.

Any Questions?

Do not hesitate to contact. I love to answer all your questions.

Thank YOU.

.(tagsToTranslate)seo(t)backlinks(t)google(t)linkbuilding(t)ranking