Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
{
// Usare IntelliSense per informazioni sui possibili attributi.
// Al passaggio del mouse vengono visualizzate le descrizioni degli attributi esistenti.
// Per altre informazioni, visitare: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: File corrente",
"type": "python",
"request": "launch",
"program": "/home/christian/Documenti/GitHub/Image-Captioning/v1/NeuralNet.py",
"console": "integratedTerminal"
}
{"name":"Main","type":"python","request":"launch","program":"${workspaceFolder}/main.py","console":"integratedTerminal",
"args": ["RNetvI", "train", "1024", "1024", "--attention", "True", "--attention_dim", "1024", "--dataset_folder", "./dataset/flickr30k_images", "--device", "cuda:0", "--splits", "1", "1", "1", "--epochs", "2"]}
]
}
347 changes: 0 additions & 347 deletions CaRNetvHC.py

This file was deleted.

Binary file added Images Documentation/ResNet-50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 christianSistemiPos
Copyright (c) 2022 christiandimaio

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
347 changes: 0 additions & 347 deletions NeuralModel/CaRNetvH.py

This file was deleted.

444 changes: 0 additions & 444 deletions NeuralModel/CaRNetvHC.py

This file was deleted.

449 changes: 0 additions & 449 deletions NeuralModel/CaRNetvI.py

This file was deleted.

128 changes: 0 additions & 128 deletions NeuralModel/Dataset.py

This file was deleted.

131 changes: 0 additions & 131 deletions NeuralModel/Vocabulary.py

This file was deleted.

37 changes: 37 additions & 0 deletions NeuralModels/Attention/IAttention.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import torch
import torch.nn as nn

class IAttention(nn.Module):
"""
Class interface for Attention unit
Args are intended as suggested.
"""
def __init__(self, *args):
"""Constructor for an Attention model

Args:
encoder_dim (int):
The number of features extracted from the image.
hidden_dim (int):
The capacity of the LSTM.
attention_dim (int):
The capacity of the Attention Model.
"""
super(IAttention, self).__init__()

def forward(self, *args):
"""Compute z_t given images and hidden state at t-1 for all the element in the batch.

Args:
images (torch.Tensor): `(batch_dim, image_portions, encoder_dim)`
The tensor of the images in the batch.
lstm_hidden_states (torch.Tensor): `(batch_dim, hidden_dim)`
The hidden states at t-1 of the elements in the batch.

Returns:
(Tuple[torch.Tensor,torch.Tensor]): `[(batch_dim, encoder_dim), (batch_dim, image_portions)]`
Z_t and the alphas evaluated for each portion of the image, for each image in the batch.
"""
pass


Loading