This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Nodo { | |
public int k; | |
public Nodo sx; | |
public Nodo dx; | |
public Nodo(int k, Nodo sx, Nodo dx) { | |
this.k = k; | |
this.sx = sx; | |
this.dx = dx; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing as mp | |
import numpy as np | |
import time | |
class CorsaDiCagnolini: | |
def __init__(self): | |
self.pool = mp.Pool(mp.cpu_count()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def estimate_error(self, inputs, targets, addToPlot=False): | |
if self.isClassification: | |
loss = 0 | |
for input, target in zip(inputs, targets): | |
output = self.feedforward(input) | |
single_loss = self.loss_function.getFunction(predicted=output, target=target) | |
loss+=single_loss | |
loss /= len(inputs) |
OlderNewer