Connect with us

# Understanding RNN Step by Step with PyTorch

Published

on

Understanding RNN Step by Step with PyTorch – Analytics Vidhya

## Learn everything about Analytics

PlatoAi. Web3 Reimagined. Data Intelligence Amplified.
Click here to access.

Source: https://www.analyticsvidhya.com/blog/2021/07/understanding-rnn-step-by-step-with-pytorch/

Published

on

# WHT: A Simpler Version of the fast Fourier Transform (FFT) you should know

The fast Walsh Hadamard transform is a simple and useful algorithm for machine learning that was popular in the 1960s and early 1970s. This useful approach should be more widely appreciated and applied for its efficiency.

By Sean O’Connor, a science and technology author and investigator.

The fast Walsh Hadamard transform (WHT) is a simplified version of the Fast Fourier Transform (FFT.)

The 2-point WHT of the sequence a, b is just the sum and difference of the 2 values:

WHT(a, b) = a+b, a-b.

It is self-inverse allowing for a fixed constant:

WHT(a+b, a-b) = 2a, 2b

Due to (a+b) + (a-b) = 2a and (a+b) – (a-b) = 2b.

The constant can be split between the two Walsh Hadamard transforms using a scaling factor of √2 to give a normalized WHTN:

WHTN(a, b) = (a+b)/√2, (a-b)/√2 WHTN((a+b)/√2, (a-b)/√2) = a, b

That particular constant results in the vector length of a, b being unchanged after transformation since a2+b2 =((a+b)/√2)2+ ((a-b)/√2)2 as you may easily calculate.

The 2-point transform can be extended to longer sequences by sequentially adding and subtracting pairs of similar terms, alike in the pattern of + and – symbols they contain.

To transform a 4-point sequence a, b, c, d first do two 2-point transforms:

WHT(a, b) = a+b, a-b WHT(c, d) = c+d, c-d

Then add and subtract the alike terms a+b and c+d:

WHT(a+b, c+d) = a+b+c+d, a+b-c-d

and the alike terms a-b and c-d:

WHT(a-b, c-d) = a-b+c-d, a-b-c+d

The 4-point transform of a, b, c, d then is

WHT(a, b, c, d) = a+b+c+d,  a+b-c-d, a-b+c-d, a-b-c+d

When there are no more similar terms to add and subtract, that signals completion (after log2(n) stages, where n is 4 in this case.)  The computational cost of the algorithm is nlog2(n) add/subtract operations, where n, the size of the transform, is restricted to being a positive integer power of 2 in the general case.

If the transform was done using matrix operations, the cost would be much higher (n2 fused multiply-add operations.)

Figure 1.  The 4-point Walsh Hadamard transform calculated in matrix form.

The +1, -1 entries in Figure 1 are presented in a certain natural order which most of the actual algorithms for calculating the WHT result in, which is fortunate since then the matrix is symmetric, orthogonal and self-inverse.

You can also view the +1, -1 patterns of the WHT as waveforms.

Figure 2.  The waveforms of the 8-point WHT presented in natural order.

When you calculate the WHT of a sequence of numbers, you are really just determining how much of each waveform is embedded in the original sequence.  And that is complete and total information with which you can fully reconstruct any sequence from its transform.

The waveforms of the WHT typically correlate strongly with the patterns found in natural data like images, allowing the transform to be used for data compression.

Figure 3.  A 65536-pixel image compressed to 5000 points using a WHT.

In Figure 3, a 65536-pixel image was transformed with a WHT, the 5000 maximum magnitude embeddings were preserved, and then the inverse transform was applied (simply another WHT.)

The central limit theorem (CLT) tells you that adding a large quantity of random numbers results in the Normal distribution with its characteristic bell curve.  The CLT applies equally to sums and differences of a large quantity of random numbers.  As a result, C.M. Rader proposed (in 1969) using the WHT to quickly generate Normally distributed random numbers from conventional uniformly distributed random numbers.  You simply generate a sequence of uniform random numbers, say between –1 and 1, and then transform them using the WHT.

Similarly, you can disrupt the orderly waveform patterns of the WHT by choosing a fixed randomly chosen pattern of sign flips to apply to any input to the transform.  That is equivalent to multiplying the WHT matrix H with a diagonal matrix D of randomly chosen +1, -1 entries giving HD.  The disrupted waveform patterns in HD then fail to correlate with any of the patterns seen in natural data.  As a result, the output of HD has the Normal distribution and is actually a fast Random Projection of the natural data.  Random projections have a wide number of applications in machine learning, such as locality sensitive hashing, compressive sensing, random projection trees, neural network pre and post-processing etc.

### References

Walsh (Hadamard) Transform:

Normal Distribution:

Random Projections:

Other Applications:

Related:

PlatoAi. Web3 Reimagined. Data Intelligence Amplified.
Click here to access.

Source: https://www.kdnuggets.com/2021/07/wht-simpler-fast-fourier-transform-fft.html

# Must-Know Text Operations in Python before you dive into NLP!

Published

on

Text Operations in Python | Must-Know Text Operations in Python for NLP

## Learn everything about Analytics

PlatoAi. Web3 Reimagined. Data Intelligence Amplified.
Click here to access.

Source: https://www.analyticsvidhya.com/blog/2021/07/must-know-text-operations-in-python-before-you-dive-into-nlp/

# Canada’s Rogers Communications beats quarterly revenue estimates

Published

on

(Reuters) -Canada’s Rogers Communications Inc on Wednesday reported second-quarter revenue that beat analysts’ estimates, helped by a pick up in advertisement sales and as its cable business benefited from a pandemic-driven shift to remote work and entertainment.

The requirement of high-speed broadband networks to carry on remote work helped the telecom operator negate the slow recovery from its wireless business.

The return of live sport broadcasting also played a positive role in boosting the Toronto-based telecom operator’s revenue.

The company’s total revenue rose to C\$3.58 billion (\$2.82 billion) in the quarter ended June 30, compared with analysts’ average estimates of C\$3.56 billion, according to IBES data from Refinitiv.

Earlier in March, Rogers said it would buy Shaw Communications Inc for about C\$20 billion (\$16.02 billion), aiming to double down on its efforts to roll out 5G throughout the country.

Revenue for its cable unit, which includes internet, phone and cloud-based services, rose 5% during the quarter

Quarterly net income rose to C\$302 million, or 60 Canadian cents per share, from C\$279 million, or 54 Canadian cents, a year earlier.

(\$1 = 1.2686 Canadian dollars)

(Reporting by Tiyashi Datta in Bengaluru; Editing by Shailesh Kuber)

##### Image Credit: Reuters

PlatoAi. Web3 Reimagined. Data Intelligence Amplified.
Click here to access.

Source: https://datafloq.com/read/canadas-rogers-communications-beats-quarterly-revenue-estimates/16522

# Climate friendly cooling tech firm gets \$50 million from Goldman Sachs

Published

on

By Jane Lanhee Lee

(Reuters) – Chemicals used in air conditioning, freezers and refrigeration have long hurt the environment by destroying the ozone layer and polluting water sources, but technology is starting to change the way we keep cool.

Phononic, a startup based in Durham North Carolina using a material called bismuth telluride to make so-called cooling chips, on Wednesday said it raised \$50 million from Goldman Sachs Asset Management.

When electricity runs through the chip the current takes heat with it leaving one side of the chip to cool and the other to heat up, said Tony Atti, Phononic co-founder and CEO.

The chips can be as small as a fraction of a fingernail or as big as a fist depending on how much coolants are needed and have been used to create compact freezers for vaccine transportation or for ice-cream at convenience stores like Circle K, he said. A more recent and fast growing use is to prevent overheating in lidars, laser-based sensors in autonomous cars, and optical transceivers for 5G data transmission, said Atti.

“The historical refrigerants that had been used for vapor compression systems, they are both toxic and global warming contributors,” said Atti. While the global warming impact had been reduced, refrigerants still had issues with toxicity and flammability.

Atti said while the bismuth telluride powder itself is toxic, when it is processed into a semiconductor wafer and made into a chip, it is “benign” and can be recycled or disposed as its meets all chip safety and disposal standards.

The cooling chips are manufactured in Phononic’s own factory in Durham and for mass production the company is working with Thailand based Fabrinet. The freezers for vaccines and ice-cream are built in China by contract manufacturers and carry the brands of Phononic’s customers or in some cases are co-branded, he said.

The funding will be used to build out high-volume manufacturing and to expand Phononic’s markets and product line.

Atti declined to share the latest valuation of Phononic but said it was “north of half a billion dollars”. Previous investors include Temasek Holdings and private equity and venture capital firm Oak Investment Partners.

(Reporting By Jane Lanhee Lee; editing by Richard Pullin)

##### Image Credit: Reuters

PlatoAi. Web3 Reimagined. Data Intelligence Amplified.
Click here to access.

Source: https://datafloq.com/read/climate-friendly-cooling-tech-firm-gets-50-million-goldman-sachs/16521