akankshakshurai/cuda-error-resolution-analysis huggingface dataset:
I am looking for a loss function sensitive to edges for medical image quality enhuncement

username: Amirhossein_Sanaat
cooked: <p>Hello,<br>
For an image-to-image translation task in which I want to generate high-quality images from low-quality images ( MRI Images), I need a loss function to highlight the edges and generate images with sharper edges.<br>
Do you have any recommendation for selecting the desired loss function between Pytorch’s loss function??<br>
<a href="https://pytorch.org/docs/stable/nn.html#loss-functions" class="onebox" target="_blank" rel="noopener nofollow ugc">https://pytorch.org/docs/stable/nn.html#loss-functions</a><br>
I really appreciate it if anyone can even provide me the code of any predefined loss function for this task.</p>
<p>Thanks</p>

username: IneedMrmeeseeks
cooked: <p>If you want to make low-quality images into high-quality images and detect the edge of it, I’d recommend the image super-resolution models(such as FSRCNN or SRGAN) and then apply edge-detecting filters like Sobel filter.</p>
<p>Also, you can manually detect the edges from any direction by using image gradient</p>
ResNet Weights Resize Size

username: fabianpedd
cooked: <p>Why do <code>IMAGENET1K_V2</code> weights for the ResNet models have a different <a href="https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py#L371" rel="noopener nofollow ugc"><code>resize_size = 232</code></a>? The default, used by the <code>IMAGENET1K_V1</code> weights, is <a href="https://github.com/pytorch/vision/blob/main/torchvision/transforms/_presets.py#L43" rel="noopener nofollow ugc"><code>resize_size = 256</code></a>.</p>
<p>Thanks!</p>
LSTM model from keras to Pytorch, RayTune hp optimization

username: DariusM11
cooked: <p>Hello there!</p>
<p>I am currently learning how to use LSTMs for a timeseries forecasting algorithm, I have to mention that I it’s my first time using LSTMs. I found and implemented a keras LSTM model and did hp optimization with keras.tuner. However I want to migrate the model to PyTorch framework and the algorithm for hp optimization to RayTune but I really struggle doing so.</p>
<p>Here is my keras LSTM model:</p>
<pre><code class="lang-auto">def build_model(hp):
    model = Sequential()
    model.add(LSTM(hp.Int('input_unit',min_value=32,max_value=512,step=32),return_sequences=True, input_shape=(train_X.shape[1],train_X.shape[2])))
    for i in range(hp.Int('n_layers', 2, 6)): 
        model.add(LSTM(hp.Int(f'lstm_{i}_units',min_value=32,max_value=512,step=32),return_sequences=True))
    model.add(LSTM(hp.Int('layer_2_neurons',min_value=32,max_value=512,step=32)))
    model.add(Dropout(hp.Float('Dropout_rate',min_value=0,max_value=0.5,step=0.1)))
    model.add(Dense(train_y.shape[1], activation=hp.Choice('dense_activation',values=['relu', 'sigmoid'],default='relu')))
    model.compile(loss='mean_squared_error', optimizer='adam',metrics = ['mse'])
    return model
</code></pre>
<p>and here is the hp tuning I performed with keras.tuner:</p>
<pre><code class="lang-auto">tuner= BayesianOptimization (
        build_model,
        objective='mse',
        max_trials=50,
        executions_per_trial=3,
        directory='randomSearchWeekly-lag-features-3-8',
        seed=123
        )
</code></pre>
<pre><code class="lang-auto">tuner.search(
        x=train_X,
        y=train_y,
        epochs=50,
        batch_size=128,
        validation_data=(test_X, test_y),
)
</code></pre>
<p>Next, the X and y train/test shapes:</p>
<p>shape for train_X: (222, 3, 8)<br>
shape for train_y: (222, 1)<br>
shape for test_X: (4, 3, 8)<br>
shape for test_y: (4, 1)</p>
<p>My dataframe contains 229 rows, based on weekly data, with 8 features (including lagged features) for each timestamp. I basically want to predict only one feature for the next week for example, based on the value of previous features with a loopback period of n weeks.</p>

username: AndreiTA
cooked: <p>Hello. I am having the same issue. It seems to me like PyTorch is not very intuitive with LSTMs?</p>
<p>Does anybody have any suggestions?</p>

username: AndreiTA
cooked: <p>I have still not solved this issue. Any help anybody?</p>