semvec/pypi-packages huggingface dataset:
Topsis-Mayank-102097021 1.0.0
Package to calculate Topsis Score
License: MIT

# TOPSIS

**T**echnique for **O**rder **P**reference by **S**imilarity to **I**deal **S**olution
(TOPSIS) originated in the 1980s as a multi-criteria decision making method.
TOPSIS chooses the alternative of shortest Euclidean distance from the ideal solution,
and greatest distance from the negative-ideal solution.

<br>

## Steps to install this package:

```
>> pip install Topsis_Mayank_102097021
```

### Example of how to run this package using CLI:

```
>> topsis data.csv 1,1,2,1,2 +,+,-,-,+ result.csv
```

## Sample input file (data.csv)

| Fund Name | P1   | P2   | P3  | P4   | P5    |
|-----------|------|------|-----|------|-------|
| M1        | 0.84 | 0.71 | 3.6 | 41.8 | 11.74 |
| M2        | 0.65 | 0.42 | 3.4 | 42.2 | 11.67 |
| M3        | 0.73 | 0.53 | 5.9 | 44.8 | 12.99 |
| M4        | 0.84 | 0.71 | 4.3 | 31.1 | 9.24  |
| M5        | 0.70 | 0.49 | 5.3 | 47.8 | 13.57 |
| M6        | 0.63 | 0.40 | 3.8 | 51.4 | 14.06 |
| M7        | 0.71 | 0.50 | 6.3 | 38.7 | 11.55 |
| M8        | 0.83 | 0.69 | 3.0 | 66.4 | 17.73 |

<br>

## Sample output file (result.csv)

| Fund Name | P1   | P2   | P3  | P4   | P5    | Topsis Score | Rank |
|-----------|------|------|-----|------|-------|--------------|------|
| M1        | 0.84 | 0.71 | 3.6 | 41.8 | 11.74 | 0.558223797  | 2    |
| M2        | 0.65 | 0.42 | 3.4 | 42.2 | 11.67 | 0.436582006  | 4    |
| M3        | 0.73 | 0.53 | 5.9 | 44.8 | 12.99 | 0.348034209  | 7    |
| M4        | 0.84 | 0.71 | 4.3 | 31.1 | 9.24  | 0.419806643  | 5    |
| M5        | 0.7  | 0.49 | 5.3 | 47.8 | 13.57 | 0.404084221  | 6    |
| M6        | 0.63 | 0.4  | 3.8 | 51.4 | 14.06 | 0.50688539   | 3    |
| M7        | 0.71 | 0.5  | 6.3 | 38.7 | 11.55 | 0.220136412  | 8    |
| M8        | 0.83 | 0.69 | 3   | 66.4 | 17.73 | 0.973068125  | 1    |

<br>
The output file contains columns of input file along with two additional columns having **Topsis Score** and **Rank**
tfvan 1.0.0
Keras (TensorFlow v2) reimplementation of Visual Attention Network (VAN) model.
License: MIT

# tfvan

Keras (TensorFlow v2) reimplementation of **Visual Attention Network** model.
Based on [Official Pytorch implementation](https://github.com/Visual-Attention-Network/VAN-Classification).

Supports variable-shape inference. All weights are obtained by converting official checkpoints. 

## Installation

```bash
pip install tfvan
```

## Examples

Default usage (without preprocessing):

```python
from tfvan import VanTiny  # + 3 other variants and input preprocessing

model = VanTiny()  # by default will download imagenet-pretrained weights
model.compile(...)
model.fit(...)
```

Custom classification (with preprocessing):

```python
from keras import layers, models
from tfvan import VanTiny, preprocess_input

inputs = layers.Input(shape=(224, 224, 3), dtype='uint8')
outputs = layers.Lambda(preprocess_input)(inputs)
outputs = VanTiny(include_top=False)(outputs)
outputs = layers.Dense(100, activation='softmax')(outputs)

model = models.Model(inputs=inputs, outputs=outputs)
model.compile(...)
model.fit(...)
```

## Evaluation

For correctness, `Tiny` and `Small` models (original and ported) tested
with [ImageNet-v2 test set](https://www.tensorflow.org/datasets/catalog/imagenet_v2).

```python
import tensorflow as tf
import tensorflow_datasets as tfds
from tfvan import VanTiny, preprocess_input


def _prepare(example):
    # Observation: +2.2% top1 accuracy in tiny model with antialias=True
    image = tf.image.resize(example['image'], (248, 248), method=tf.image.ResizeMethod.BICUBIC)
    image = tf.image.central_crop(image, 0.9)
    image = preprocess_input(image)

    return image, example['label']


imagenet2 = tfds.load('imagenet_v2', split='test', shuffle_files=True)
imagenet2 = imagenet2.map(_prepare, num_parallel_calls=tf.data.AUTOTUNE)
imagenet2 = imagenet2.batch(8)

model = VanTiny()
model.compile('sgd', 'sparse_categorical_crossentropy', ['accuracy', 'sparse_top_k_categorical_accuracy'])
history = model.evaluate(imagenet2)

print(history)
```

| name | original acc@1 | ported acc@1 | original acc@5 | ported acc@5 |
| :---: | :---: | :---: | :---: | :---: |
| Tiny | 59.22 | 61.59 | 82.32 | 84.52 |
| Small | 70.17 | 68.62 | 89.17 | 88.54 |

## Citation

```
@article{guo2022visual,
  title={Visual Attention Network},
  author={Guo, Meng-Hao and Lu, Cheng-Ze and Liu, Zheng-Ning and Cheng, Ming-Ming and Hu, Shi-Min},
  journal={arXiv preprint arXiv:2202.09741},
  year={2022}
}