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) |
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
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
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
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
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
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
public class Main { | |
public static void main(String[] args) { | |
Nodo foglia1 = new Nodo(-10,null,null); | |
Nodo foglia2 = new Nodo(-2,null,null); | |
Nodo foglia3 = new Nodo(4,null,null ); | |
Nodo foglia4 = new Nodo(10,null,null); | |
Nodo livello1 = new Nodo(-5, foglia1,foglia2); | |
Nodo livello2 = new Nodo(5,foglia3,foglia4); |
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 android.annotation.SuppressLint; | |
import android.app.Dialog; | |
import android.content.Context; | |
import me.pushapp.sosmedico.R; | |
/** | |
* Created by Denny on 21/11/2017 with pizza | |
*/ |
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
private String getIpAccess() { | |
WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); | |
int ipAddress = wifiManager.getConnectionInfo().getIpAddress(); | |
final String formatedIpAddress = String.format("%d.%d.%d.%d", (ipAddress & 0xff), (ipAddress >> 8 & 0xff), (ipAddress >> 16 & 0xff), (ipAddress >> 24 & 0xff)); | |
return "http://" + formatedIpAddress + ":"; | |
} |
NewerOlder