Posts

PLINQ IN .Net

PLINQ Methods Example PLINQ Methods Example PLINQ takes your data query and, like a team of clones, processes different parts of the data at the same time. It’s like having multiple shoppers in the store, each with a copy of the shopping list, working in parallel to finish the shopping faster. using System; using System.Linq; using System.Threading; using System.Threading.Tasks; class PLINQMethodsExample { static void Main(string[] args) { // Example data source var numbers = Enumerable.Range(1, 100); // AsParallel to enable parallelization var parallelQuery = numbers.AsParallel(); // WithDegreeOfParallelism to limit the number of processors to use var limitedParallelismQuery = numbers.AsParallel().WithDegreeOfParallelism(2); // WithExecutionMode to hint PLINQ on how to execute the query var forcedParallelismQuery = numbers.AsParallel().WithExecutionMo...

BACKPROBAGATION IN NEURAL NETWORK

Code Sample and Text Backpropagation In Python In the case of simple feedforward neural networks, the process of backpropagation can be done efficiently in Python. First, we will import the necessary libraries. import numpy as np Next, we will define a simple neural network with one hidden layer. def sigmoid(x): return 1.0 / (1 + np.exp(-x)) def sigmoid_derivative(x): return x * (1.0 - x) class NeuralNetwork: def __init__(self, x, y): self.input = x self.weights1 = np.random.rand(self.input.shape[1],4) self.weights2 = np.random.rand(4,1) self.y = y self.output = np.zeros(self.y.shape) def feedforward(self): self.layer1 = sigmoid(np.dot(self.input, self.weights1)) self.output = sigmoid(np.dot(self.layer1, self.weights2)) def backprop(self): # application of the chain rule to find d...

Facade Design Pattern C#

Image
Facade Pattern Facade Pattern We assume that you have a few things and you get them with one facade. I demonstrated 1 class. But i am sure that you would understand clearly.

Singleton Pattern In C#

Image
Singleton Pattern ,readonly,thread safe,singleton,single instance,c#"> Singleton Pattern It is used to for if we want to send single object to other classes in our class. So what can we do this type situations? Answer is so simple. Singleton class. So us class is not derived for other classes, it must send one instance to others, and other classes reach the element on it. Instance is readonly, static. So we when created it that can one time assigned and we reach to it anywhere in class.And also we used Lazy&ltT&gt. It provides waiting time until instance created. So memory will doesn't busy with this instance until it called. Simple and effective method to memory management. References Lazy&ltT&gt readonly sealed Singleton Class

Type Conversion C#

Image
Type Conversion Type Conversion In C# It showed type conversion in shortly. Actually it has been created for note. I hope so you can find your search in following code sample. References BitConverter Int32.Parse User-defined type casting

Event In C#

Image
C# Event Event Event provides a way to access and see the happens. For this purpose it may works with delegate. I demonstrate how does it work on sample topic. I talked about which keyword what does it work. Call the event. Create and define event References delegate event Invoke()

Action Using With Asynchronous Tasks In C#

Image
Asynchronous , c#, nameof"> Asynchronous Tasks If you have a many process and you have to run asynchron so you can use Asynchronous Tasks . This article contains many feature. You can discover the references topic in the bottom side and i can sure that you will find many funny contents. Have fun with coding. Output : References Action Asynchronous nameof